You now have the tools and techniques needed to write interesting and complete Java programs. In the lessons of this tutorial, we’ll walk through writing a complete falling-blocks puzzle game. To do this, you’ll need to install a Java development environment on your computer, but first, let’s talk about the rules of the game and some elements of how we might design the code.

The basic rules of the game are the same as for the game Tetris™; you can easily find several browser-based implementations of Tetris with a web search.

A tetromino is a shape composed of four blocks. Here’s a screenshot of the game in action, with five tetrominos on the screen; there are only a few types of tetrominos, and they are colored by type in the screenshot.

Get hands-on with 1400+ tech skills courses.