Move physic object

Sep 12, 2012 at 3:18 PM

How i can move a physic object or change the size in the code? For example to control a player by the keyboard?

Coordinator
Sep 12, 2012 at 3:34 PM

To move a physics object, you need to ApplyForce.

PhysicsSprite spr = cnvGame.PhysicsObjects["ball"];
spr.BodyObject.ApplyForce(new Vector2(xVel, yVel));

if you need your sprite to not rotate, you can use Fixed Rotation:

spr.BodyObject.FixedRotation = true;

Resizing (scaling) an object is a bit involved. I have done it for my app (demo here - http://www.youtube.com/watch?v=mYE6rYLi15w&list=UUjW3rmSx2bXeUnFcN4o-yOw&index=5&feature=plcp)

... but I have not yet created a function in Physics Helper for it.

Sep 12, 2012 at 6:48 PM

Thanks that helps me a lot