Advertisement
Guest User

input processing

a guest
Sep 18th, 2015
251
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Vector2 offsetDirection = Vector2.Zero;
  2.  
  3. if (Controller.IsButtonDown(Buttons.Left))
  4.     offsetDirection.X -= 1;
  5. if (Controller.IsButtonDown(Buttons.Right))
  6.     offsetDirection.X += 1;
  7.  
  8. if (Controller.IsButtonDown(Buttons.Up))
  9.     offsetDirection.Y -= 1;
  10. if (Controller.IsButtonDown(Buttons.Down))
  11.     offsetDirection.Y += 1;
  12.  
  13. if (offsetDirection == Vector2.Zero)
  14.     return;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement