I've written one couple of years ago, but the src is not public. What you need is: Look how tetris works and figure out how to do this by yourself. It is fairly simple. Why do you need the source "to modify it to [your] needs" instead of writing it all from scratch?
|