Block Movement XNA

Topics: User Forum
Sep 27, 2013 at 3:39 PM
sorry if i repost i want to ask about how to stop an object if the object collide with another object

I've been looking in all the site but no response ..
what because I am new in XNA or I considered stupid by others

maybe if you could give an example of how to do it ..
sorry if my english mess
Sep 29, 2013 at 10:39 PM
Try using the OnCollision() event.

In the event you have access to variables usually called Fixure1 and Fixture2.

You can change the properties of the body through this.

For example

fixtureA.Body.LinearVelocity = Vector2.Zero;

Would stop fixture1's body from moving.

Have fun