Computer Science Canada Collision Dectection - !!!AGAIN!!! |
Author: | Canned [ Sat Nov 24, 2007 12:46 pm ] | ||||||
Post subject: | Collision Dectection - !!!AGAIN!!! | ||||||
Ok, I got it to work so that when they collide:
they dont go through each other. Yet when I go to push from the other side:
they just switch places. So I wrote this to try and stop it:
and all it did was make it so they keep pushing each other away.. I have no control over it. Any help? |
Author: | isaiahk9 [ Mon May 05, 2008 5:53 pm ] |
Post subject: | Re: Collision Dectection - !!!AGAIN!!! |
with this code you wrote : if x1 > x4 and x3 < x2 and y4 < y1 and y3 < y2 then You're making it so that if the boxes are anywhere then they'll switch. Instead, go like this : if View.Whatdotcolor (x2, y1) = blue then %red box drawbox -5 %bluebox drawbox + 5 that's it, i think. |