public void Update() { if (doInitDelay) { initialDelay--; } if (initialDelay <= 0) { doInitDelay = false; currentCommand = new NullCommand(); keyboardState = Keyboard.GetState(); foreach (Keys key in keyboardState.GetPressedKeys()) { if (commandLibrary.ContainsKey(key)) { currentCommand = commandLibrary[key]; currentCommand.Execute(); break; } } if (keyboardState.GetPressedKeys().Length == 0) { player.Idle(); } } }