Exemplo n.º 1
0
 private void UpdateMovementInput(InputManager input)
 {
     float dY = 0;
     float dX = 0;
     if (input.isPressed(Up))
         dY -= 1;
     if (input.isPressed(Down))
         dY += 1;
     if (input.isPressed(Left))
         dX -= 1;
     if (input.isPressed(Right))
         dX += 1;
     if (dX == 0 && dY == 0)
         Player.Stop();
     else
         Player.Go();
     Player.SetHeading(Math.Atan2(dY, dX));
 }
Exemplo n.º 2
0
 private void UpdateShootingInput(InputManager input)
 {
     if (input.isPressed(Shoot))
         Player.Shoot();
     else
         Player.HoldFire();
 }