Hey guys... don't know whether should ask here but I give it a try How do I use the engine for a top down game? I have currently some issues but they maybe because I use it wrong. I controll my player with the arrow-keys or with wasd-keys.
I wrote some code that handle the movement like this:
this.body.LinearVelocity = Vector2.Zero;
var movement = Vector2.Zero;
movement.X = -1;
else if (inputState.IsScrollRight())
movement.X = 1;
movement.Y = -1;
else if (inputState.IsScrollDown())
movement.Y = 1;
if (movement != Vector2.Zero)
var velocity = movement * (250/100) * (float)gameTime.ElapsedGameTime.TotalSeconds;
this.body.ApplyLinearImpulse(new Vector2((int)Math.Round(velocity.X), (int)Math.Round(velocity.Y)));
But it seams to be the wrong way, because the diagonal movement is way faster than the left,right,top or bottom.
The next thing is, how to stop the player? Each frame I manually set the LinearVelocity to zero, but that could be wrong too?
All tipps are welcome.