示例#1
0
        private void DetermineNextSteps()
        {
            //You have been detected
            if (stateMachine.detectionLevel >= 100)
            {
                //to game over state
                stateMachine.StartCoroutine(ChangeState(GameplayStateMachine.GameplayState.GameOver));
            }
            //You won! Somehow
            else if (stateMachine.GetRound() == stateMachine.GetGameBlueprint().combinationCount)
            {
                stateMachine.gameWon = true; //GAME WON!

                //update score with win points!
                stateMachine.playerScore += stateMachine.GetGameBlueprint().pointsForWin;
                stateMachine.TriggerHUDEvent(UIEvents.Type.UpdateScoreText, stateMachine.playerScore.ToString());
                //To Game over state
                stateMachine.StartCoroutine(ChangeState(GameplayStateMachine.GameplayState.GameOver));
            }
            //continue game
            else
            {
                //Unlock progress orb
                stateMachine.TriggerHUDEvent(UIEvents.Type.UnlockProgressOrb);
                //Update Score Text
                stateMachine.TriggerHUDEvent(UIEvents.Type.UpdateScoreText, GetUpdatedScore().ToString());
                //TO DISPLAY STATE
                stateMachine.StartCoroutine(ChangeState(GameplayStateMachine.GameplayState.Display));
            }
        }
示例#2
0
        public void Begin()
        {
            //increment the round we are on
            stateMachine.IncrementRound();
            //incrmenet combination count
            stateMachine.ResetCombinationCount();

            stateMachine.StartCoroutine(WaitForDisplay());

            stateMachine.TriggerHUDEvent(UIEvents.Type.ChangeGameStatusText, "Displaying Combination");
        }
示例#3
0
        private void WONGAME()
        {
            //move out camera
            stateMachine.TriggerGameplayEvent(GameplayEvent.Type.CameraChange, GameplayCamera.LocationKey.Win.ToString());
            //Play game Over sound
            GAMEManager.Instance.PlaySound(AudioFiles.GameplaySoundClip.GameWin);
            //OPEN SAFE!
            stateMachine.TriggerGameplayEvent(GameplayEvent.Type.OpenSafe);

            //Display game over panel
            stateMachine.StartCoroutine(DisplayGameOverPanel(7.5f));
        }
示例#4
0
        public void Update()
        {
            if (!receivingInput)
            {
                return;
            }

            if (userInput.NumberPressed())
            {
                int number = userInput.GetNumberPressed();
                //Play Sounds
                stateMachine.PlaySound(AudioFiles.GameplaySoundClip.UserInput);
                //display number on screen
                stateMachine.TriggerHUDEvent(UIEvents.Type.PrepareCombinationNumber, number.ToString());
                stateMachine.TriggerHUDEvent(UIEvents.Type.DisplayCombinationNumber, CombinationDisplay.Type.Normal.ToString());

                //spawn anim number
                stateMachine.TriggerHUDEvent(UIEvents.Type.SpawnAnimNumber, number.ToString());

                //add to state controller user input
                stateMachine.AddToUserInput(number);
                //increment number count
                NumberCount++;
                if (stateMachine.GetRound() == NumberCount)
                {
                    receivingInput = false;

                    stateMachine.StartCoroutine(FadeOutNumbers());
                }
            }
        }
示例#5
0
        public void Begin()
        {
            //remove game over panel
            stateMachine.TriggerHUDEvent(UIEvents.Type.ToggleGameOverPanel, HUD.VisibleToggle.Hide.ToString());

            //camera change
            stateMachine.TriggerGameplayEvent(GameplayEvent.Type.CameraChange, GameplayCamera.LocationKey.Main.ToString());

            //reset hud
            stateMachine.TriggerHUDEvent(UIEvents.Type.ResetProgressOrbs);
            stateMachine.TriggerHUDEvent(UIEvents.Type.UpdateDetectionSlider, 0.ToString());
            stateMachine.TriggerHUDEvent(UIEvents.Type.UpdateScoreText, 0.ToString());

            //RESET MAIN VARIABLES
            stateMachine.GenerateCombination();
            stateMachine.gameWon                 = false;
            stateMachine.achievedHighScore       = false;
            stateMachine.round                   = 0;
            stateMachine.detectionLevel          = 0;
            stateMachine.currentCombinationCount = 0;
            stateMachine.playerScore             = 0;

            //transition
            stateMachine.StartCoroutine(TransitionToDisplay());
        }
示例#6
0
        public void Begin()
        {
            stateMachine.TriggerHUDEvent(UIEvents.Type.SceneComeIn);

            stateMachine.StartCoroutine(IntroSequence());
        }