This project has moved. For the latest updates, please go here.

Collision Handler

Topics: Developer Forum, Project Management Forum, User Forum
Oct 31, 2007 at 9:39 AM
I'm making a 2D car racing game, and i'm so impressed with your Engine.
It run so good. The collisions with primitves shapes are fun!.
Now I'm in a trouble. I've to reset the car throtlle and brake when the car collide with the level object (buildings, ..)
I'm looking for a event handler. I read your post about the demo8 and the demo with truck, but i can't find anywhere :S
I'm also read the post about this code:

but i don't know how to create CollisionEventArgs ...

myRBPhysicsObject.Collision += new EventHandler<CollisionEventArgs>(myCollision);

public void myCollision(object sender, CollisionEventArgs e)
//argh! I've been hit by e.Body2

Thanks in advance.
Oct 31, 2007 at 10:55 AM
ok, my chief has solved it
Here the code :

Geom VehicleColl;
VehicleColl.CollisionHandler += new Geom.CollisionHandlerDelegate(onCollision();

public bool onCollision(Geom geometry1, Geom geometry2, ContactList contactList)
//TODO: your code here