Exemplo n.º 1
0
        /// <summary>
        /// Event Handler for when Player Uses Up and Down Keys
        /// </summary>
        /// <param name="i"></param>
        /// <param name="index"></param>
        /// <returns></returns>
        public int Movement(ConsoleKeyInfo i, int index)
        {
            //Array of Enum options for game difficulty
            GameDifficulty.Difficulty[] difficulty = new GameDifficulty.Difficulty[] { GameDifficulty.Difficulty.Easy, GameDifficulty.Difficulty.Normal, GameDifficulty.Difficulty.Hard };

            if (i.Key == ConsoleKey.DownArrow)
            {
                index++;
                if (index > 2)
                {
                    index = 0;
                }
            }
            else if (i.Key == ConsoleKey.UpArrow)
            {
                index--;
                if (index < 0)
                {
                    index = 2;
                }
            }

            //Update Screen
            _gameConsoleView.SetUpGame(index, difficulty);
            return(index);
        }
Exemplo n.º 2
0
        private void GameIntroduction()
        {
            _menuMusic.playSound(true);

            // display splash screen
            _playingGame = _gameConsoleView.DisplaySpashScreen();

            if (!_playingGame)
            {
                Environment.Exit(1);
            }

            //Get game difficulty
            int x = SetUpGameDifficulty();

            _gameDifficulty = (GameDifficulty.Difficulty)x;

            // display introductory message
            _gameConsoleView.DisplayGamePlayScreen("Introduction", Text.Introduction(), ActionMenu.Introduction, "");
            _gameConsoleView.GetContinueKey();

            //Get Player info
            InitializeMission();

            _menuMusic.stopSound(true);
            _thunder.playSound(true);

            Rules();

            AssignXP();

            //Assign Random Key Location
            GameObject   gameObject = _gameUniverse.GetGameObjectById(5);
            PlayerObject Key        = (PlayerObject)gameObject;

            Key.LocationId = _gameUniverse.AssignRandomLocation(Key);

            //Set Initial location
            _currentLocation = _gameUniverse.GetLocationById(_gamePlayer.LocationID);

            //Display Current Location
            _gameConsoleView.DisplayGamePlayScreen(_currentLocation.Name, Text.IntroLocationInfo(), ActionMenu.MainMenu, "");
        }