Computer Science Canada Collision Detection Problem |
Author: | Fashoomp [ Mon May 21, 2007 3:53 pm ] | ||
Post subject: | Collision Detection Problem | ||
For my racing game, i am trying to figure out collision. I found a sample code just for movement, and im trying to change it for collision. Its a ball that moves on screen. I drew a line on screen, and was wondering if anyone can show me how to make the ball not able to pass through that line. Heres the code
|
Author: | Carey [ Tue May 22, 2007 8:45 am ] |
Post subject: | Re: Collision Detection Problem |
You could use whatdotcolour to check if you are touching the line, or you could check the distance from the line with Math.Distance. If the distance from the line is equal to the radius of your ball then bounce. |