Core code for Brick Battle