Skip to main content

Tetris Easter egg for Swing applications

Posted by kirillcool on June 30, 2006 at 10:51 AM PDT

The Matrix rain project that was refactored to the laf-widget layer was not the first one. Even before that i took my first (ever) game written in Java and ported it to a (kind of) Easter egg for Swing apps. The project itself is called trellis and contains a collection Tetris-like games with pluggable shapes and rules. Currently, there are three different kinds of games and four different kinds of shapes. My personal would be the tetris on hexagonal grid, but it takes quite some time to get used to.


As with the previous entry, here is the WebStart link. You'll have to either save it to your machine or run javaws http://weblogs.java.net/blog/kirillcool/archive/trellis/trellis.jnlp from the command prompt.
When you hit Ctrl+Alt+T, you will see the following (quite ugly, since this was written back in 2001) selector screen:



choose.png



Choose the game kind and the tile kind and click "Start the game". Based on your choice, you will have one of the 12 available games, such as the regular lines with square tiles:



square-lines.png



A more exotic tetris on hexagonal grid:



hexa-tetris.png



Or even the esoteric piles with Mitsubishi grid:



mitsu-pile.png



The controls are:

  • Left arrow to move left
  • Right arrow to move right
  • r to rotate shape
  • Up arrow to rotate colors (not relevant for Tetris)
  • Down arrow to rotate colors (not relevant for Tetris)
  • Space to drop shape (depends on the game kind)