Collision detection for cubes in the board