Computer Science Canada Ball Bouncing Screensaver |
Author: | xmen [ Thu Mar 25, 2004 11:48 pm ] |
Post subject: | Ball Bouncing Screensaver |
hey apparently i hav made a program where a ball (or happy face) bounces around the screen.....but what i need for this screensaver is to have two balls bouncing around the screen instead of just one, also when the two balls meet they will also bounce away my question is......does anyone of you hav a program similar to this?? or can anyone plzzzzz help me help with this as to how i can modify my program plz reply asap thankyou |
Author: | Tony [ Fri Mar 26, 2004 12:57 am ] |
Post subject: | |
well you employ circular collision detection to check if balls are coliding or not. If the distance between two centers is equal to the sum of two radii, then balls are just touching each other. Then you figure out how balls bounce back... We've got some nice pool programs posted and I think even some discussion on the physics of collisions. |
Author: | Cervantes [ Fri Mar 26, 2004 1:40 am ] |
Post subject: | |
circular collisions is my entire compsci life I still can barely get them to work is this an assignment? if it is, and if you're in grade 10, I think you are probably doing a harder question than asked for. that, or your teacher is a madman. if it isn't an assignment and you're doing this for fun, and you are in grade 10, it would probably be wise to make the project easier. Check out thoughtful's pool tutorial for some circle collision data. |
Author: | xmen [ Fri Mar 26, 2004 3:17 pm ] |
Post subject: | |
im in grade 10 in canada and yes this is an assignment |
Author: | Hunter007 [ Thu Apr 01, 2004 4:15 pm ] | ||
Post subject: | |||
Hey thought I'd help you out... I did this project last semester, but no winking faces. The faces are just circles inside bigger circles. Heres the code, reply if you need more help...
|
Author: | Jodo Yodo [ Thu Apr 01, 2004 5:38 pm ] |
Post subject: | |
Is there a way to make the collision detection circular instead of in a box shape? Because right now, it the program works well because the circles are small. But if the circles were bigger, it would be more obvious that the collision detection is in the shape of a square. |
Author: | Cervantes [ Sat Apr 03, 2004 2:16 pm ] | ||
Post subject: | |||
Yes there is. tony wrote: If the distance between two centers is equal to the sum of two radii, then balls are just touching each other.
|
Author: | the_short1 [ Thu Apr 08, 2004 10:52 pm ] |
Post subject: | |
now i know why tony is adicted to taht... !!!! GOOD STUFF!!! i like math.distance now.... ehehhehe..... thanks for the information ppl..... now i can make my jezzball ten times better... |