Added 'clean' to makefile to make removing binaries before commits easier and fixed logic error in breakout.c
This commit is contained in:
parent
841efab5eb
commit
d274b674e5
@ -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
|
||||
|
||||
@ -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)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user