// Inicia o jogo public static void StartGame() { // Inicializa o Mapa MapManager.MapGen(); // Inicializa o movimento do personagem Character.CharacterMovement(); // Inicializa o User Interface UserInterface.InGame(); Console.WriteLine(); MenuJogo.GameMenu(); // Inicializa os outros métodos do personagem Character.CharacterCollision(); Character.CharacterLife(); Character.CharacterTurn(); // Inicializa as Armas Weapons.UseWeapons(); Weapons.RepairWeapon(); // Inicializa o Inimigo Enemy.EnemyLife(); Enemy.EnemyMove(); Enemy.EnemyAction(); }
// Volta para o menu quando estiver em jogo public static void StartVoltaAoMenu() { // Inicializa o User Interface UserInterface.InGame(); // Inicializa o Menu MenuJogo.GameMenu(); // Inicializa o Personagem Character.CharacterMovement(); Character.CharacterCollision(); Character.CharacterLife(); Character.CharacterTurn(); }
// Movimento do personagem public static void CharacterMovement() { #region Variável Local Character chr = new Character(); MenuJogo mj = new MenuJogo(); ConsoleKeyInfo input; WriteLines.Character_InputESC(); WriteLines.Character_InputQ(); #endregion do { input = Console.ReadKey(true); Console.SetCursorPosition(chr.leftAndRight, chr.upAndDown); Console.WriteLine(" "); switch (input.Key) { case ConsoleKey.RightArrow: chr.leftAndRight++; break; case ConsoleKey.LeftArrow: chr.leftAndRight--; break; case ConsoleKey.DownArrow: chr.upAndDown++; break; case ConsoleKey.UpArrow: chr.upAndDown--; break; case ConsoleKey.Escape: WriteLines.Character_Movement_Space(); MenuJogo.GameMenu(); break; case ConsoleKey.Q: Environment.Exit(0); break; } Console.SetCursorPosition(chr.leftAndRight, chr.upAndDown); Console.Write(chr.charGameObject); }while (chr.gameOver == 0); if (chr.gameOver == 1) { Console.Beep(); } }