Skip to main content
GameDev.net gamedev.net
🔒 Locked

Spherical bouncing/deflection

Started by Xeon06 Feb 19, 2007 at 10:23 AM 1 replies 850+ views
Original Post
Xeon06
Xeon06
Hey folks, I am making a little game in which balls are bouncing around the window. Ive got that part okay, bouncing on the sides of the screen or on any plane is kinda easy. But the thing is, they gotta bounce within themselves too. I cant come up with a theorical way of doing this. I know the following: -If there is a collision between 2 balls (if (distance_between_two_balls < (radius*2))) -The x and y position of both balls -The direction in degrees of both balls (I can convert to radians if needed tough) (0 is right, 90 up, etc) -Both balls should have the same speed and mass Could you guys help me comming up with some theorical solution? I dont want any code please, because you guys will probably give me some C++ and Im making that game in C# (ok, not many differences and I can easily read it but err...) Many thanks, Alex.
Xeon06
Xeon06
Thanks a lot for this, I'll look into that tonight.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.