check_hit_brick.asm - 89erik/NES-breakout GitHub Wiki
Tree: root /src/loop/check_hit_brick.asm
This file contains the CheckHitBrick subroutine which determines if the ball is currently hitting a brick, including bouncing the ball, killing the brick, and switching to the next level.
CheckHitBrick
- For all bricks, check if brick is being hit.
- If a brick was hit, call the KillBrick sub routine.
- For the brick being hit, calculate bounce direction and then bounce.
KillBrick
- Set brick presence to false and queue it for drawing.
- If no more present bricks left, load next level.
- Else, increase kill count and dispense a token according to token frequency.