public void Update() { if (Player.TurnTimeout == 0) { var key = TCODConsole.waitForKeypress(true); Point dest = new Point(Player.Position.X, Player.Position.Y); switch (key.KeyCode) { case TCODKeyCode.Escape: Over = true; return; case TCODKeyCode.KeypadFour: case TCODKeyCode.Left: dest.X--; break; case TCODKeyCode.KeypadEight: case TCODKeyCode.Up: dest.Y--; break; case TCODKeyCode.KeypadSix: case TCODKeyCode.Right: dest.X++; break; case TCODKeyCode.KeypadTwo: case TCODKeyCode.Down: dest.Y++; break; case TCODKeyCode.KeypadSeven: dest.X--; dest.Y--; break; case TCODKeyCode.KeypadNine: dest.X++; dest.Y--; break; case TCODKeyCode.KeypadOne: dest.X--; dest.Y++; break; case TCODKeyCode.KeypadThree: dest.X++; dest.Y++; break; case TCODKeyCode.KeypadDecimal: case TCODKeyCode.KeypadFive: if (Player.Stamina < Player.MaxStamina) { Player.Stamina = Math.Min(Player.Stamina + 10, Player.MaxStamina); } if (Player.HP < Player.MaxHP && Game.Current.RNG.Next(8) == 0) { Player.HP = Math.Min(Player.HP + 1, Player.MaxHP); } break; case TCODKeyCode.Enter: if (TCODConsole.isKeyPressed(TCODKeyCode.Alt)) { TCODConsole.setFullscreen(!TCODConsole.isFullscreen()); } break; } if ((dest.X != Player.Position.X || dest.Y != Player.Position.Y) && Player.Stamina > 0) { Player.MoveToPosition(dest); Player.Stamina--; Player.TurnTimeout += 5 - Player.Speed; } } foreach (Character c in Area.Current.Characters) { c.Update(); } foreach (Decal d in Area.Current.Decals) { d.Update(); } if (Player.HP < 1) { Console.WriteLine("GAME OVER"); Draw(); while (true) { if (TCODConsole.waitForKeypress(true).KeyCode == TCODKeyCode.Escape) { Over = true; break; } } } }