You are reading a single comment by @allObjects and its replies. Click here to read the full conversation.
  • You need a buffer... but may be not a display/output buffer... but something has to represent the 'board' - 16x8 matrix - which is actually better than fallen/settled blocks. There is no need to check against all fallen blocks. When a block is fallen, the board is updated. Collision detection uses the board and the block's 'next' position - a maximum of four comparisons. Next positions are the next fall position, 90 degree left/right rotated block on same position, or move left/right position. If the next position would be a fall position, the block settles. If it cannot rotate or move left/right because of detected collision, nothing is done. The fallen blocks are kept for an eventual redraw - or - when you do not score when fallen/settled but at the end when game is over.

About

Avatar for allObjects @allObjects started