A stealth-based 2D platformer where you don't have to kill anyone unless you want to. https://www.semicolin.games
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

23 lines
593 B

  1. using Microsoft.Xna.Framework.Input;
  2. using System.Collections.Generic;
  3. namespace Jumpy {
  4. public class KeyboardInput {
  5. private KeyboardState oldState = Keyboard.GetState();
  6. private List<Keys> newKeysDown = new List<Keys>();
  7. public void Update() {
  8. KeyboardState newState = Keyboard.GetState();
  9. newKeysDown.Clear();
  10. foreach (Keys k in newState.GetPressedKeys()) {
  11. if (!oldState.IsKeyDown(k)) {
  12. newKeysDown.Add(k);
  13. }
  14. }
  15. oldState = newState;
  16. }
  17. public List<Keys> NewKeysDown() {
  18. return newKeysDown;
  19. }
  20. }
  21. }