When the current shape stops at the bottom, the next shape starts to drop. In themain()function, before the while loop (game loop), you will create two Tetris objects at the same time:currentTetrisShape, andnextTetrisShape. Inside the game loop, when the current shape is stuck, you check whether a line is complete. Then, you callcurrentTetrisShape.setShape(nextTetrisShapeType). In thesetShape()function, you assign the properties of the shape:shapeType, top left X and Y,shapeArray, etc. Then you callnextTetrisShape.setShape(use a new randomly generated int).

"Get 15% discount on your first 3 orders with us"
Use the following coupon
FIRST15

Order Now