Beispiel #1
0
        public void Hide()
        {
            IsActive = false;
            GameMain.IsPlayerMovementBlock = false;

            if (dialogNumber > 0)
            {
                GameProgress.SetDialogsValue(dialogNumber);
            }

            playerSentences       = new List <PlayerSentence>();
            currentPage           = 0;
            currentPlayerSentence = 0;
            dialogNumber          = 0;
        }
Beispiel #2
0
 public void EnterCode()
 {
     if (userInput.Length < 4)
     {
         if (KeyboardManager.IsKeyPressed(Keys.D0) && !KeyboardManager.IsPreviousKeyPressed(Keys.D0))
         {
             userInput += "0";
         }
         else if (KeyboardManager.IsKeyPressed(Keys.D1) && !KeyboardManager.IsPreviousKeyPressed(Keys.D1))
         {
             userInput += "1";
         }
         else if (KeyboardManager.IsKeyPressed(Keys.D2) && !KeyboardManager.IsPreviousKeyPressed(Keys.D2))
         {
             userInput += "2";
         }
         else if (KeyboardManager.IsKeyPressed(Keys.D3) && !KeyboardManager.IsPreviousKeyPressed(Keys.D3))
         {
             userInput += "3";
         }
         else if (KeyboardManager.IsKeyPressed(Keys.D4) && !KeyboardManager.IsPreviousKeyPressed(Keys.D4))
         {
             userInput += "4";
         }
         else if (KeyboardManager.IsKeyPressed(Keys.D5) && !KeyboardManager.IsPreviousKeyPressed(Keys.D5))
         {
             userInput += "5";
         }
         else if (KeyboardManager.IsKeyPressed(Keys.D6) && !KeyboardManager.IsPreviousKeyPressed(Keys.D6))
         {
             userInput += "6";
         }
         else if (KeyboardManager.IsKeyPressed(Keys.D7) && !KeyboardManager.IsPreviousKeyPressed(Keys.D7))
         {
             userInput += "7";
         }
         else if (KeyboardManager.IsKeyPressed(Keys.D8) && !KeyboardManager.IsPreviousKeyPressed(Keys.D8))
         {
             userInput += "8";
         }
         else if (KeyboardManager.IsKeyPressed(Keys.D9) && !KeyboardManager.IsPreviousKeyPressed(Keys.D9))
         {
             userInput += "9";
         }
     }
     if (KeyboardManager.IsKeyPressed(Keys.Back) && !KeyboardManager.IsPreviousKeyPressed(Keys.Back))
     {
         if (userInput.Length >= 1)
         {
             userInput = userInput.Substring(0, userInput.Length - 1);
         }
     }
     if (KeyboardManager.IsKeyPressed(Keys.Enter) && !KeyboardManager.IsPreviousKeyPressed(Keys.Enter))
     {
         if (GameProgress.TerminalCodes[terminalNumber] == userInput)
         {
             GameProgress.SetTerminalValues(0);
         }
         else
         {
             framesCountFail = 60;
         }
     }
 }