shogoki-vnz / CraftyBox2D

A Crafty component tha facilitates the use of the Physics Engine Box2D(box2dweb)
45 stars 13 forks source link

Make collision handling more robust #10

Open ndarilek opened 10 years ago

ndarilek commented 10 years ago

I find myself missing Begin/EndContact methods. The current framework is good enough to detect when a collision is happening, but not when it begins or ends.

I'm not sure what the best way to handle this is. Maybe onContactBegin/onContactEnd functions similar to onContact?

Failing that, how would one easily detect that a collision began to play an appropriate sound?

Thanks.

shogoki-vnz commented 10 years ago

I will try to look a it this weekend

ndarilek commented 10 years ago

Excellent. At the moment I have a very hacky check in my EnterFrame to detect new collisions, but it'd be good to refactor to onContactBegin/End or something similar.

ndarilek commented 10 years ago

Cool, any updates? I keep finding places that'd benefit from knowing when a collision begins or ends. Would a PR providing this functionality be accepted?