Skip to content

Commit

Permalink
Fixed collisions
Browse files Browse the repository at this point in the history
  • Loading branch information
kliao2016 committed Nov 13, 2017
1 parent b5bd541 commit 1393848
Show file tree
Hide file tree
Showing 4 changed files with 1 addition and 1 deletion.
Binary file modified BrickBreaker.elf
Binary file not shown.
Binary file modified BrickBreaker.gba
Binary file not shown.
2 changes: 1 addition & 1 deletion game.c
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ void handleBrickCollisions(Brick *brptr, Ball *ballptr, int *numBricks, int bric
ballptr->xDir *= -1;
ballptr->col = ballptr->col + (ballptr->xDir * 5);
} else if ((((ballptr->row + BALLSIZE) == brptr->row)
|| (ballptr->row == (brptr->row + BRICKHEIGHT)))
|| (ballptr->row == (cur->row + BRICKHEIGHT)))
&& ((ballptr->col >= (cur->col - BALLSIZE))
&& (ballptr->col <= (cur->col + BRICKWIDTH)))) {
*(numBricks) -= 1;
Expand Down
Binary file modified game.o
Binary file not shown.

0 comments on commit 1393848

Please sign in to comment.