Implementing the Tetris gameplay
As we are concerned with implementing gameplay, the activity that we will focus on developing further in this chapter is GameActivity
. The following screenshot shows the final product of all the development done in this chapter:

Now that we have an idea of what the final game is going to look like, let's get going with its development.
Under the section Understanding Tetris in Chapter 2, Building an Android Application – Tetris we got to understand that Tetris is a puzzle-matching game that makes use of tiles. These tiles combine to form bigger shapes called tetrominoes. As a reminder, a tetromino is a geometric shape composed of four squares connected orthogonally.
Modeling a tetromino
As tetrominoes are very crucial to the gameplay of Tetris, we must properly model these elements programmatically. In order to do this, let's think of every tetromino piece as a building block. Building blocks have a set of features that they possess. These features can be categorized...