Andariel Sharp

Andariel Sharp

  • NA
  • 19
  • 4.5k

XNA how can i insert the jumping in my character?

Jul 31 2015 11:44 PM
ks = Keyboard.GetState();
if (ks.IsKeyDown(Keys.Right) && position.X <= 680)
{
position.X += 2f;
currentAnim = forwardWalk;
Animate(gameTime);
}
else if (ks.IsKeyDown(Keys.Left) && position.X >= 0)
{
position.X -= 2f;
currentAnim = backWalk;
Animate(gameTime);
}
How can i make Up key for jump?