Questions tagged [bouncing]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
1
vote
1answer
135 views

Ball bounces just above paddle

When I run the following code the ball bounces just above the paddle (around 10 pixels above the paddle). I haven't messed with the detect-collision function and following are my initPaddle() and code ...
0
votes
1answer
397 views

pset4-breakout ball bouncing

On Pset4 "bounce" Can anyone please help me in bouncing the ball at angles after it touches the window edges and paddle?! I mean is what all the math computation involved in it?? a pseudocode highly ...
0
votes
2answers
377 views

detect collision paddle Pset4

My detect collision or detect walls algorithm does not seem to be working. The ball does not seem to be bouncing off the walls or detecting objects. What's annoying is that I was able to get the ...
0
votes
1answer
522 views

calling srand48 rand vrs srand

I was tinkering with the bounce function in pset4 trying to get the ball the bounce randomly around the window. I am getting stuck with PRNG. I just can't seem to get it to work using the srand48 ...
1
vote
1answer
313 views

Cannot get both paddle moving and ball bouncing at the same time (pset4)

I can get either the paddle following the cursor, or the ball bouncing, but not both at the same time. I've succeeded in making the ball bounce code loop within the while loop, by enclosing it in an ...
0
votes
2answers
344 views

pset4 velocity & ball's angle

I'm stuck in step 6. I have understood how to make the ball bounce on the window's edges but I cannot figure out how to make the ball move in an angle. I assume that it has to be some combination of Y-...