Computer Science Canada

Hit Detection

Author:  upthescale [ Tue Apr 18, 2006 8:25 pm ]
Post subject:  Hit Detection

Hit Detections with ovals? Anyone wanan explain that quicktime

Author:  [Gandalf] [ Tue Apr 18, 2006 8:40 pm ]
Post subject: 

Ovals, or circles? If it's only circles then:
code:
if Math.Distance (ballA.x, ballA.y, ballB.x, ballB.y) <= ballA.radius + ballB.radius then
     put "Collision!"
else
     put "No collision"
end if

This checks if the distance between the centers of two circles is greater than the sum of their radii, and if so you know it is a collision.

Author:  upthescale [ Tue Apr 18, 2006 8:43 pm ]
Post subject: 

math distance doesnt werk in my turing!!!!!

Author:  Cervantes [ Tue Apr 18, 2006 8:56 pm ]
Post subject: 

Then make your own.


: