This project has moved and is read-only. For the latest updates, please go here.

Changing direction of an object

Topics: User Forum
Sep 25, 2011 at 4:40 PM

Hi, i've been working on a project and need some help. I'm trying to get an object to get a "inversed" direction when it hits the walls or the platform which you control. I linked a picture demonstrating what I want it to do at the bottom.

Is there anyone who has any tips on how this can be done? Right now it can come in from say the left and then bounces straight up with a 90 degree angle to the object.

I cannot find anything in the documentation about how this might be handled.

Sorry if this is a stupid question but I'm new to programming :) Grateful for all help!


How i want it to act:


Sep 26, 2011 at 12:29 PM
Edited Sep 26, 2011 at 12:30 PM

first of all use vectors instead of angles and power (if you don't allready do that).

your inverse is very easy to do and i don't think you need farseer for that.

if your are making something like pong you just need to inverse the X or Y value of the ball to make him bounce.