Computer Science Canada Circular Collision Detection question |
Author: | Abbas_M [ Sun Jan 17, 2010 2:16 pm ] | ||
Post subject: | Circular Collision Detection question | ||
What is it you are trying to achieve? I want to know how to use circular collision detection between to images imported into turing for my game. What is the problem you are having? i dont know how to find the radius of the two images that will be coliding since the command to draw pictures is something Pic.Draw (image, x, y, picMerge) it doesnt have the x2 and y2 values which are the radius so how would i find the radius of these images. Describe what you have tried to solve this problem Read numerous tutorials tried to put 2 more values in the Pic.Draw command but it was to many parameters Post any relevant code (You may choose to attach the file instead of posting the code if it is too long)
Please specify what version of Turing you are using 4.1.1 All help is appreciated. |
Author: | TheGuardian001 [ Sun Jan 17, 2010 2:33 pm ] | ||
Post subject: | Re: Circular Collision Detection question | ||
If they take up the full width and height of the image, you can use
which will give you the radius (since it takes up the entire size of the image, and radius is diameter/2) If your images don't take up the entire width, open them in an image editor and find out, or guess. Either way though, your collision detection will not check for collisions accurately, as x1 and y1 refer to the lower left corner of the image, not the center. |
Author: | Abbas_M [ Sun Jan 17, 2010 2:40 pm ] |
Post subject: | Re: Circular Collision Detection question |
i tryed using for rectangular collision detection but for some reason i fail and it does not work correctly. Edit: it worked fine so far... thanks for the help appreciate it. now on to other problems . |