Exemplo n.º 1
0
 void CustomInitialize()
 {
     _gameIsActive                  = false;
     _instructionsStartedAt         = PauseAdjustedCurrentTime;
     InstructionsTimeLeftText.Text  = "Ready!";
     InstructionsDisplayedText.Text = InstructionsText;
     GameTimeLeft.Text              = GameTimeDurationInSeconds.ToString();
     MiniGameBaseGumRuntime.ApplyState(MiniGameBaseGumRuntime.GameState.InstructionScreen.ToString());
     ContentBlocker.Z = 11;
 }
Exemplo n.º 2
0
        void CustomActivity(bool firstTimeCalled)
        {
            if (_gameIsActive)
            {
                var secondsRemaining = GameTimeDurationInSeconds - PauseAdjustedSecondsSince(_gameStartedAt);
                GameTimeLeft.Text = ((int)secondsRemaining).ToString();
                if (secondsRemaining <= 0)
                {
                    GlobalData.GameplayData.LastMinigameResult = LastMinigameResult.Loss;
                    MoveToScreen(typeof(Scoreboard));
                }
            }
            else
            {
                var secondsRemaining = InstructionsDurationInSeconds - PauseAdjustedSecondsSince(_instructionsStartedAt);
                var oneThirdTime     = (double)InstructionsDurationInSeconds / 3;
                if (oneThirdTime * 2 < secondsRemaining)
                {
                    InstructionsTimeLeftText.Text = "Ready!";
                }
                else if (oneThirdTime <= secondsRemaining)
                {
                    InstructionsTimeLeftText.Text = "Set!";
                }
                else
                {
                    InstructionsTimeLeftText.Text = "Go!";
                }

                if (secondsRemaining <= 0)
                {
                    _gameIsActive  = true;
                    _gameStartedAt = PauseAdjustedCurrentTime;
                    MiniGameBaseGumRuntime.ApplyState(MiniGameBaseGumRuntime.GameState.GameActive.ToString());
                    GameStarted();
                }
            }
        }