Collision Detections - DerekJi/ngtetris GitHub Wiki
As moving the running piece, all occupied blocks should not
- be outside of the playfield
- NOT over the right wall:
bX = pX + bx < W
- NOT over the left wall:
bX = pX + bx >= 0
- NOT over the bottom:
bY = pY + by < H
- NOT over the right wall:
- be overlapped by any existing occupied blocks in the playfield
PlayField[bY][bX] < 1