/// <summary>
        /// Event handler for when the Play Game menu entry is selected
        /// </summary>
        void LoadGameMenuEntrySelected(object sender, EventArgs e)
        {
            // Load the player information
            SaveAndLoadGame.LoadGame();

            // Continue onto the match info screen
            LoadingScreen.Load(ScreenManager, true, new MatchupInfoScreen());
        }
Пример #2
0
    public static void LoadScene(Scene scene, bool save)
    {
        SaveAndLoadGame.Save();
        switch (scene)
        {
        case Scene.MainMenu:
            UnityEngine.SceneManagement.SceneManager.LoadScene(0);
            break;

        case Scene.TestLevel:
            UnityEngine.SceneManagement.SceneManager.LoadScene(1);
            break;
        }
    }
 /// <summary>
 /// Event handler for when the wipe save menu entry is selected
 /// </summary>
 void WipeSaveMenuEntrySelected(object sender, EventArgs e)
 {
     // Wipe the save data
     SaveAndLoadGame.WipeSave();
 }
Пример #4
0
        /// <summary>
        /// Lets the game respond to player input. Unlike the Update method,
        /// this will only be called when the gameplay screen is active
        /// </summary>
        public override void HandleInput(InputState input)
        {
            if (input == null)
            {
                throw new ArgumentNullException("input");
            }

            // Look up inputs for the active player profile
            KeyboardState keyboardState = input.CurrentKeyboardStates;

            // Check to see if the game is paused (esc)
            if (input.IsPauseGame())
            {
                // Add the pause screen
                ScreenManager.AddScreen(new PauseMenuScreen());
            }
            // Check to see if a menu element was selected and ensure that the match is not over
            if (input.IsMenuSelect() && !matchOver)
            {
                // Swap the turn state
                playerTurn = !playerTurn;

                // Check if it is the player's turn
                if (playerTurn)
                {
                    // Let the player select a move
                    player.SelectMove(enemy, PlayerInfo.Moves[selectedMove], playerSpriteManager);
                }
                else
                {
                    // Select the move after the player has selected their move (Z pressed a second time)
                    enemy.SelectMove(player, enemySpriteManager);
                }

                // Check to see if the enemy is dead
                if (enemy.CurrentHP <= 0)
                {
                    // Increment the player wins and set the match to over
                    PlayerInfo.Wins += 1;
                    matchOver        = true;

                    // Play the downed animation
                    enemySpriteManager.CurrentAnimation = "Down";
                }
                // Check to see if the player is dead
                else if (player.CurrentHP <= 0)
                {
                    // Increment the palyer losses and set the match to over
                    PlayerInfo.Losses += 1;
                    matchOver          = true;

                    // Play the downed animation
                    playerSpriteManager.CurrentAnimation = "Down";
                    // Load enemy win anim
                }
            }
            // Check to see if the start button was pressed and ensure that the match is over
            if (input.IsStartButton() && matchOver)
            {
                // Load the training screen if there are still enemies to face
                if (PlayerInfo.Wins < 4)
                {
                    LoadingScreen.Load(ScreenManager, false, new TrainingScreen());
                }
                // Otherwise, wipe the save data and go back to the main menu
                else
                {
                    SaveAndLoadGame.WipeSave();
                    LoadingScreen.Load(ScreenManager, false, new MainMenuScreen());
                }
            }

            // Check if the player is navigating the menu to the left
            if (input.IsMenuLeft())
            {
                // Decrement the selected move
                selectedMove--;

                // Wrap the selected move back around to end if it passes behind the start
                if (selectedMove < 0)
                {
                    selectedMove = maxMoves - 1;
                }
            }
            // Check if the player is nagivating the menu to the right
            if (input.IsMenuRight())
            {
                // Increment the selected move
                selectedMove++;

                // Wrap the selected move back to the beginning if it goes beyond the end
                if (selectedMove >= maxMoves)
                {
                    selectedMove = 0;
                }
            }
        }
 private void Awake()
 {
     instance = this;
 }
Пример #6
0
 // Use this for initialization
 void Start()
 {
     SaveAndLoadGame.Inizalize();
     SaveAndLoadGame.Load();
 }
Пример #7
0
 /// <summary>
 /// Event handler for when the Quit and Save menu entry is selected.
 /// </summary>
 void QuitAndSaveGameMenuEntrySelected(object sender, EventArgs e)
 {
     // Save the game and exit
     SaveAndLoadGame.SaveGame();
     ScreenManager.Game.Exit();
 }
Пример #8
0
 public static void EndGame()
 {
     SaveAndLoadGame.Save();
     Application.Quit();
 }