Questions tagged [collision-detection]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0
votes
2answers
93 views

Pset3 Breakout: Question on variable scope in while loop

I'm working through pset3 and noticed that when I declare my ball's velocities outside the while loop, my collisions against the wall's edges work, i.e. the ball bounces away, but when the velocities ...
0
votes
1answer
133 views

Pset3 Breakout Ball blatantly ignores velocity change when colliding with wall

Something rather strange is taking place while I test my collision detection for the ball hitting the walls. The code below to my eye seems correct to make the ball bounce off of all 4 walls of the ...
0
votes
1answer
184 views

Collision detection with the paddle

This is collision detection with paddle (bottom right and left ) But the ball passes through the paddle and it is velocity does not change. my questions are Is this the right implementation of ...
0
votes
0answers
52 views

Touching Color Issues, Recursion and Pseudo-randoms in Scratch

http://scratch.mit.edu/projects/42012966 Hello All, So I was trying to build this little recursive scribbler that makes random little networks of lines, basically like an ant colony but have run into ...
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 ...
-1
votes
1answer
169 views

(pset4) Why is the paddle not bouncing the ball?

Ok, soI have this code that makes it so that the ball just rests on the paddle instead of bouncing off. So, my solution would be to do something like break; but for if statements. Problem being such a ...
3
votes
2answers
672 views

Segmentation fault when trying to detect collisions in breakout

This line of code results in the error Segmentation Fault (Core dumped): collision = detectCollision(window, ball); if (strcmp(getType(collision), "GRect") == 0) { // TODO } What is ...
2
votes
2answers
272 views

Breakout slows down just before finishing the game

Just before finishing a game of Breakout, the game start to move very slow and the paddle behaves weirdly. The game works fine for the first 40 bricks. What causes this? This is my code: GObject ...
3
votes
1answer
448 views

Bricks are not available to the detectCollision function

My detectCollision function detects collisions between ball and paddle, but not between ball and bricks. Bricks 'exist' in 'window' but they don't exist in main(). I thought detectCollision might ...
2
votes
3answers
820 views

Collision of ball with other objects

I don't understand what I actually have to do for the collision of ball with other objects. I am at the state where ball and paddle are just moving but collision is not yet defined. What should I do ...