Page 1 of 1

Collision Help

Posted: Mon Jan 07, 2013 3:01 pm
by BobTheLawyer
Ok, so I am using bounding box as my collision check.

From there, I am trying to get a left collide, a right collide, an upcollide, and a down collide.

Right now, the apple is the object I am trying to get collision to work for (I think). If I am wrong then which everone you control with wasd.
The gavel (controlled by the arrows) has messed up collision for some reason, so I am only trying to perfect the apple at the moment.

Here is my .love:
http://www.mediafire.com/?qpozf7x3azfabal

So move the gavel wherever you want (in the middle I guess) and then start checking out the collision with the apple.
If you go down right or down left into the gavel, you teleport to a side of it.
That doesn't work if you start next to it, and then start pushing left and down.

Up left and up right will teleport no matter what.
I could implement what I did with the downcollide, but I haven't yet.

The problem is, for my collide, it checks if collide is true for each individual thing.
So if it turns true for one, I want to have true for it.
If I am not colliding, I want to be able to keep moving.
The problem is, I am also getting a false for each other thing I am checking, so I need to know how to make one true for collision, outweigh all my falses.

I'm really bad at explaining this...
If someone understands and can explain this better, please do.

Re: Collision Help

Posted: Tue Jan 08, 2013 6:39 pm
by markgo
Each of your object were updating their movement twice because your object was colliding with itself and not colliding with the other object. This caused you to move twice as fast. Your physics checking wasn't logical so I restructured it. Best to resolve one direction and then the other direction.

Re: Collision Help

Posted: Tue Jan 08, 2013 9:54 pm
by BobTheLawyer
Thank you so much!