soggybag / tetris-redux-app

Tetris built with React and Redux
https://soggybag.github.io/tetris-redux-app/
4 stars 6 forks source link

Bug fix - blocks above top of grid #4

Closed soggybag closed 5 years ago

soggybag commented 5 years ago

Fix bug where Game Over appears when clicking left or right before a block falls into view.

Recreate the problem by tapping the left or right button immediately after a block has just been placed and a new created. If the newly created piece is above the top of the grid and it is moved off the left or right side the game registers a game over.

A good place to start is gameReducer.js. Anytime a block is moved the reducer calls the canMoveTo() method from utils/index.js. This method takes shape, grid, x, y, rotation parameters and checks to see if the block could be moved to these values.

soggybag commented 5 years ago

Closed