We now have written a reasonably complete, reasonably fun
game of Tetris. Congratulations!
That said, our game is somewhat minimalist, leaving many opportunities for additional work by your students. Here are some ideas:
A "Pause" feature;
Dual rotation (adding clockwise rotation in addition to counterclockwise rotation);
Hard drop: hitting a key (such as space bar) immediately drops a piece as far as it can go and places it on the board;
"Splash screens" with help instructions;
More attractive pieces (look into Graphics2D for some interesting options);
Piece Preview (so you can see what the next piece will be before it arrives);
Levels of play with increasing difficulty (dropping faster, with more difficult piece types, and with some cells randomly filled, etc);
High scores list (even better: stored on the web and shared across users);
Integration with Swing widgets (buttons, menus, etc);
Making this implementation more object-oriented (seeing as it basically isn't at this point) -- for example, adding an abstract Piece class with LPiece, SPiece, and so on as subclasses, and then actual falling pieces as instances;
A Piece editor (so you can create new types of pieces); and
Network-based multiplayer versions.
Enjoy!!!
David Kosbie |