Computer Science Canada How do you check for object collisions? |
Author: | Poutine King [ Tue Apr 20, 2004 10:16 am ] |
Post subject: | How do you check for object collisions? |
As the topic asks, how do you check for object collisions? I tired this: (the x, y, x2, y2 are the positions of two circles) if x =x2 and y=y2 then x:= 0 y:= 0 x2:=100 y2:=100 end if the ":=0" or ":=100" is so that they go in a prison but the first circle goes there right off the bat. How do you check for two objects colliding??? |
Author: | Delos [ Tue Apr 20, 2004 11:20 am ] |
Post subject: | |
[url=http://www.compsci.ca/v2/viewtopic.php?t=3525] Checking for Collision Detection. By DanShadow. [/url] That is how. |
Author: | gamer [ Tue Apr 20, 2004 6:10 pm ] |
Post subject: | |
thnx...good link |
Author: | Poutine King [ Thu Apr 22, 2004 10:09 am ] |
Post subject: | |
Uhh, what about characters?? I can make boundries and walls work but how does it work with another moving odject? |
Author: | Paul [ Fri Apr 23, 2004 8:55 pm ] |
Post subject: | |
you could use whatdotcolor and check for the edge of one object, or u could just use coordinates and compare the 2 different positions. |
Author: | Poutine King [ Thu Apr 29, 2004 10:23 am ] |
Post subject: | |
Actually the walls don't work??? ![]() |
Author: | Paul [ Thu Apr 29, 2004 3:22 pm ] | ||
Post subject: | |||
huh? Idk if this helps u, its just a ball u can move with ur arrow keys, and whatdotcolor collision on the corners work... is this what u mean?
|
Author: | Poutine King [ Fri Apr 30, 2004 8:17 am ] |
Post subject: | |
YES! Thank you so much, now it works! Bless your soul sonny. |