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

how to properly respond to collisions

Topics: Developer Forum, User Forum
Apr 6, 2012 at 12:08 AM

hello  guys, im new using the far seer engine, so far i love it; but i dont understand everything :P


im making a simple game of dodging bouncing balls, i understand that i need to use an onCollision method. but how can i identifie what the second body is, i have other balls and the bounds of the stage. i want to identify which one the body collides to act accordingly, also i have the balls whith an initial force applied to them, how can i make it so when they collide, they bounce properly   :S


thanks in advance

Apr 6, 2012 at 3:29 PM
Edited Apr 6, 2012 at 3:29 PM

You don't have to do anything, that's what Farseer is for.

All you have to do is "attach" your balls (pun intended xD) to a FPE "body". First you should have created a FPE world in whcih bodies are created. Once you have a world and the balls and walls have a body everything should work automatically without needing you to calculate anything.