diff --git a/breakout/breakout.c b/breakout/breakout.c index 6564eff..6005307 100644 --- a/breakout/breakout.c +++ b/breakout/breakout.c @@ -377,7 +377,7 @@ void updateBall(Uint32 tickrate, ball *theBall, paddle *thePaddle, int winWidth, if (colliding) { if (theBall->isColliding == 0) { - theBall->isColliding == 1; // This keeps track of any current attepmts to 'solve' collision + theBall->isColliding = 1; // This keeps track of any current attepmts to 'solve' collision // Without this flag, if the ball ends up within another object and moving slow enough that on the next frame it has not escaped the object, // it will repeatedly have its velocity multiplied by -1 and get stuck, effectively moving only along one axis. With this flag, // the game will ignore subsequent collisions, until it is no longer colliding. Note this does not solve the same problem where two objects @@ -646,4 +646,4 @@ void initialiseBricks(brick *bricks, int *brickCount) { bricks[110] = (brick) { .brickType = 4, .x = 401, .y = 214, .width = 30, .height = 10, .destroyed = 0 }; bricks[111] = (brick) { .brickType = 4, .x = 433, .y = 214, .width = 30, .height = 10, .destroyed = 0 }; *brickCount = 112; -} \ No newline at end of file +} diff --git a/breakout/makefile b/breakout/makefile index f9e9cab..5686b41 100644 --- a/breakout/makefile +++ b/breakout/makefile @@ -3,3 +3,6 @@ breakout_c = breakout all: breakout.c clang $(breakout_s) -l SDL2 -lGLU -lGL -lm -o $(breakout_c) ./breakout + +clean: breakout.c + rm $(breakout_c)