Advertisement
ada1711

Untitled

Jul 5th, 2024
15
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.55 KB | None | 0 0
  1. namespace SpaceInvaders.Managers
  2. {
  3. public static class InputManager
  4. {
  5. public static void HandleInput(Player player, List<Bullet> bullets)
  6. {
  7. if (Raylib.IsKeyDown(KeyboardKey.Left))
  8. {
  9. player.MoveLeft();
  10. }
  11. if (Raylib.IsKeyDown(KeyboardKey.Right))
  12. {
  13. player.MoveRight();
  14. }
  15. if (Raylib.IsKeyPressed(KeyboardKey.Space))
  16. {
  17. bullets.Add(player.Shoot());
  18. }
  19. }
  20. }
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement