Added 'clean' to makefile to make removing binaries before commits easier and fixed logic error in breakout.c

This commit is contained in:
Joe Adams 2018-01-10 12:30:45 +00:00
parent 841efab5eb
commit d274b674e5
2 changed files with 5 additions and 2 deletions

View File

@ -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

View File

@ -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)