From f23c57326eeebce962fafc91aa4d604d1d062e6d Mon Sep 17 00:00:00 2001 From: Kevin Liao Date: Mon, 13 Nov 2017 22:59:55 -0500 Subject: [PATCH] Fixed some collisions --- BrickBreaker.elf | Bin 550528 -> 550528 bytes BrickBreaker.gba | Bin 208208 -> 208208 bytes game.c | 8 ++++---- game.o | Bin 3324 -> 3324 bytes 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/BrickBreaker.elf b/BrickBreaker.elf index 86885d92848ba451333bdd5c241891bca6b8e9af..9332029b1b8b1c0d60f31c3a7c0aa859360fb673 100755 GIT binary patch delta 100 zcmZoTtJnZUTNropn%$|+U{H!msLqJajB={Zh)S%^kj`MxW(SK)0mWy7#b*JdNM|r;vxCK@fa0^k;@Wlod_07gk5Pyhe` delta 81 zcmca`i|4{Eo((&B&2Cj^FepVORA)qIMmbeyL?u>dNM|r;vxCK@fa0^k;@Wlod_07Zu&P5=M^ diff --git a/game.c b/game.c index 40ec87b..e3c4c01 100644 --- a/game.c +++ b/game.c @@ -125,18 +125,18 @@ void ballMovement(Ball *ballptr, Slider *sldptr, Brick *brptr, int *numBricks, i */ void handleCollisions(Ball *ballptr, Slider *sldptr) { - if (ballptr->col < 0) { + if (ballptr->col <= 0) { ballptr->col = 0; ballptr->xDir *= -1; } - if (ballptr->row < 0) { + if (ballptr->row <= 0) { ballptr->row = 0; ballptr->yDir *= -1; } - if (ballptr->col + BALLSIZE > SCREENWIDTH) { - ballptr->col = SCREENWIDTH - BALLSIZE; + if (ballptr->col + BALLSIZE >= SCREENWIDTH) { + ballptr->col = SCREENWIDTH - BALLSIZE - 1; ballptr->xDir *= -1; } diff --git a/game.o b/game.o index 433bf8971c7aea6688e649ed19497521c4bbed79..526ff60be92d654e4fba7420f57acb2989664a1a 100644 GIT binary patch delta 67 zcmew(`A2etCbQX{>I?>@sD$c_=*%dm>Wrww>I~@&25ok*xD-%)HduTXP&_(=)%d+O P``zk{SDWLR=W+r7SsEE} delta 67 zcmew(`A2etCbQYC>I?>@sD$c_=*%dm>Wrww>I~@&25ok*xD-%)HduTXP&_(=)%b%p P``zk{*PG*+=W+r7Sa2C{