Showing NEXT tetromino

To add strategy to the game, we need to show the next tetromino that will fall after the current one has landed.

The idea: Don't random generate the current tetromino, but the next one. When the current tetromino lands, you already know which tetromino will fall from the top because the next tetromino becomes the current one, and you will generate a new random next tetromino.

The development: We need a new class level variable where the value of the next falling tetromino is stored.

private const TS:uint=24; private var fieldArray:Array; private var fieldSprite:Sprite; private var tetrominoes:Array = new Array(); private var colors:Array=new Array(); private var tetromino:Sprite; private var currentTetromino:uint; private ...

Get Flash Game Development by Example now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.