CodePlexProject Hosting for Open Source Software
Wondering if there is a way to cause OnCollision to continuously fire while another body intersects? I am basically trying to make "gravity zones" out of sensor bodies that impose a force on any body that comes in to contact with them.
I'm trying to avoid handling it externally from the engine if possible, in order to keep overhead down.
When OnCollision is triggered, you set a flag like
colliding = true;
Then on the OnSeparation, you set
colliding = false;
Then, in your update method:
//Do whatever you want
Yeah, I was expecting that would be the solution. I was hoping I could avoid it, but not a big deal.
Got it all going. Thanks for the help.
The result: http://www.youtube.com/watch?v=fSNQ-mGpccM
Glad it helped. The video looks very nice, and your project seems quite interesting, love the tile level editor.
You can also return false in OnCollision event so next time when the world is updated event will be fired again.
Are you sure you want to delete this post? You will not be able to recover it later.
Are you sure you want to delete this thread? You will not be able to recover it later.