Example #1
0
 public override void HandleInput(InputMenuState input)
 {
     if (input.IsPauseGame(ControllingPlayer))
     {
         ScreenManager.AddScreen(new PauseMenuScreen(), ControllingPlayer);
     }
 }
Example #2
0
 public override void HandleInput(InputMenuState input)
 {
     if (input.IsPauseGame(ControllingPlayer))
     {
         ScreenManager.AddScreen(new PauseMenuScreen(), ControllingPlayer);
     }
     if (level.MatchFinished(out index) == true)
     {
         if (coroutine.Finished == false)
         {
             coroutine.Update();
         }
     }
 }
Example #3
0
        public override void HandleInput(InputMenuState input)
        {
            if (input.IsMenuDown(ControllingPlayer) == true)
            {
                characterScroll--;

                if (characterScroll < 0)
                {
                    characterScroll = characters.Length - 1;
                }

                if (characterScroll > characters.Length - 1)
                {
                    characterScroll = 0;
                }
            }

            if (input.IsMenuUp(ControllingPlayer) == true)
            {
                characterScroll++;

                if (characterScroll < 0)
                {
                    characterScroll = characters.Length - 1;
                }

                if (characterScroll > characters.Length - 1)
                {
                    characterScroll = 0;
                }
            }

            if (input.IsButtonAPressed(ControllingPlayer) == true)
            {
                if (playerName.Length < maxNameLength)
                {
                    if (characterScroll >= 0)
                    {
                        playerName += characters[characterScroll];
                    }
                }
            }

            if (input.CurrentKeyboardStates[0].IsKeyDown(Keys.Tab) == true)
            {
                if (input.LastKeyboardStates[0].IsKeyUp(Keys.Tab) == true)
                {
                    if (playerName.Length < maxNameLength)
                    {
                        if (characterScroll >= 0)
                        {
                            playerName += characters[characterScroll];
                        }
                    }
                }
            }


            if (input.IsButtonBPressed(ControllingPlayer) == true)
            {
                int removeLetter = playerName.Length - 1;

                if (removeLetter >= 0)
                {
                    playerName = playerName.Remove(removeLetter);
                }
            }


            if (input.CurrentKeyboardStates[0].IsKeyDown(Keys.Delete) == true)
            {
                if (input.LastKeyboardStates[0].IsKeyUp(Keys.Delete) == true)
                {
                    int removeLetter = playerName.Length - 1;

                    if (removeLetter >= 0)
                    {
                        playerName = playerName.Remove(removeLetter);
                    }
                }
            }

            if (input.CurrentKeyboardStates[0].IsKeyDown(Keys.Back) == true)
            {
                if (input.LastKeyboardStates[0].IsKeyUp(Keys.Back) == true)
                {
                    int removeLetter = playerName.Length - 1;

                    if (removeLetter >= 0)
                    {
                        playerName = playerName.Remove(removeLetter);
                    }
                }
            }

            if (input.IsPauseGame(ControllingPlayer) == true ||
                input.CurrentKeyboardStates[0].IsKeyDown(Keys.Enter) == true)
            {
                playerData.PlayerName = playerName;
                HighTime.SaveData(levelName, playerData);

                ScreenManager.AddScreen(new TimeScreen(levelName, currentZone, currentLevel),
                                        ControllingPlayer);
            }
        }