i'm currently working on breakout.c
, but i'm having trouble with the ball continuing to bounce off the bottom even after it drops below the paddle (step 9 of the spec walkthrough). Instead, I want it to return to a specific location and then pause until the user clicks again.
I'm not quite sure where i'm going wrong, and i've searched through this site/google and can't seem to find tips on this specific issue. Someone on the slack channel pointed me in the right direction re: coordinates, but it doesn't seem to have made an impact. I've tried it several ways already, including putting it in another loop that checks for null (even though i'm not sure that would make sense given that it's in the while loop that already does that?)
Here is what I think is the relevant code snippet:
while (lives > 0 && bricks > 0)
{
....
// minus one life if ball falls to the bottom --not working
else if (getY(ball) >= 600)
{
lives = lives - 1;
waitForClick();
setLocation(ball, 150, 300);
}
.....
}