Collision Event

3 views
Skip to first unread message

neolao

unread,
May 11, 2007, 9:25:12 AM5/11/07
to APE General
Hi,

I try to use APE in my game project : http://code.google.com/p/puppetwar/
It works well, but I need a feature: I want to know when there is a
collision.

Do you plan to add something like CollisionEventDispatcher ?

neolao

unread,
May 11, 2007, 9:48:50 AM5/11/07
to APE General
I found that the event can be dispatched in
CollisionResolver.resolveParticleParticle function

alec...@gmail.com

unread,
May 11, 2007, 10:55:29 AM5/11/07
to APE General
Hi,

There's no built in events in the current release, but events are
planned for collisions (and other things) in the 0.5 version which is
scheduled for july 1 release.

You'll be able to use the standard AS3 event model. Something along
the lines of

myparticle.addEventListener(particleEvent.COLLISION,
myCollisionHandler)

and so on. The event object will contain all the information about the
event, which particle collided, the velocity, collision normal, etc.

For now, like you discovered, you can place a callback in the
CollisionResolver to handle it.

Thanks,
Alec

Reply all
Reply to author
Forward
0 new messages