Behaviors of a block

The main behavior of a block is its ability to experience distinct motions. These motions are translational motion and rotational motion. Translational motion is a type of motion in which a body shifts from one point in space to another. In Tetris, a block can experience leftward, rightward, and downward translational motions. Rotational motion is a type of motion that exists in rigid bodies and follows a curved path. In other words, rotational motion involves the rotation of an object in free space. All blocks in Tetris can be rotated.

Now that we understand the basic characteristics and behaviors of a block, you may be wondering how we can translate them to be relevant to tetrominoes. The truth is no translation of these characteristic features is necessary. All characteristics of a block apply to a tetromino. The only two things to keep in mind are:

  • Tetrominoes are made up of four tiles
  • All tiles in a tetromino are orthogonally arranged

Having said that, let's get to translating these characteristics into programmatic models. We will start with modeling shape.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.133.123.126