By user12608660 on Feb 05, 2010
Here is another simple Java FX game: Broken Tetris. This game looks like Tetris, except the dropped bricks won't stay in place.
Objective is to make blocks of the same color hit each other. Once two blocks of the same color collide, they disappear. Be careful: some colors may look alike!
Controls: Left-Right to move the brick, Up to rotate.
See how many points you can get...
A few Java FX UI controls are used to set parameters for the game. You can control gravity, friction and restitution. Or increase the number of colors to make the game more challenging. You can also turn block rotation off to make them behave more like Tetris blocks.
Note a couple of useful FX techniques
- Node transforms are used to rotate the blocks and move them around
- Opacity animation makes the colliding blocks melt and disappear.
- Paiting blocks with radial gradient gives them a more interesting appearance
Click on the image below to start the game.