Game Development Reference
In-Depth Information
Figure 11.2
Creating a console application.
Tetris is a good first game to program; at first glance it appears simple, but when
you start to break it down you will find some interesting challenges. In case you
are not familiar with Tetris the aim is to create a horizontal line of blocks without
gaps. Once such a line is created, the line disappears and the blocks above drop
down to replace the line. Different colored and shaped blocks fall from the top of
the game area and the player must rotate and move the blocks to maximize the
number of lines completed. As the game progresses, the speed of the falling
blocks increases.
A first goal for creating a Tetris is to make small 1x1 blocks fall from the top of
the playing area to the bottom and then stop. Additional blocks should stack up
on top of the ones that have fallen before them. This starting goal can be seen in
Figure 11.3. Once you've got this code working, then you've really broken the
back of writing a Tetris game.
The next stage in developing the game is to detect when the game is lost. This is
when the number of blocks stacks so high it reaches the top of the playing area.
Basic player input should be implemented next allowing the blocks to be moved
 
Search WWH ::




Custom Search