Exemplo n.º 1
0
        /// <summary>
        /// Toggle game panel and go to display state
        /// </summary>
        /// <returns></returns>
        private IEnumerator TransitionToDisplay()
        {
            yield return(new WaitForSeconds(3.0f));

            stateMachine.TriggerHUDEvent(UIEvents.Type.ToggleGamePanel, HUD.VisibleToggle.Display.ToString());
            yield return(new WaitForSeconds(1.0f));

            stateMachine.ChangeState(GameplayStateMachine.GameplayState.Display);
        }
Exemplo n.º 2
0
        public void Begin()
        {
            //init generate combination
            stateMachine.GenerateCombination();
            //UI
            stateMachine.TriggerHUDEvent(UIEvents.Type.InitProgressWidget, stateMachine.GetGameBlueprint().combinationCount.ToString());

            //GO TO INTRO STATE
            stateMachine.ChangeState(GameplayStateMachine.GameplayState.Intro);
        }
Exemplo n.º 3
0
        private IEnumerator FadeOutNumbers()
        {
            //wait a second to give the user time
            yield return(new WaitForSeconds(3f));

            //remove numbers on UI
            stateMachine.TriggerHUDEvent(UIEvents.Type.RemoveCombination, combinationFadeOutTime.ToString());
            //fade out combination
            yield return(new WaitForSeconds(combinationFadeOutTime));

            //TO INPUT STATE
            stateMachine.ChangeState(GameplayStateMachine.GameplayState.Input);
        }
Exemplo n.º 4
0
        private IEnumerator IntroSequence()
        {
            yield return(new WaitForSeconds(cameraInWaitTime));

            //bring in camera
            stateMachine.TriggerGameplayEvent(GameplayEvent.Type.CameraChange, GameplayCamera.LocationKey.Main.ToString());
            //bring in Game Panel
            yield return(new WaitForSeconds(cameraInWaitTime));

            stateMachine.TriggerHUDEvent(UIEvents.Type.ToggleGamePanel, HUD.VisibleToggle.Display.ToString());
            yield return(new WaitForSeconds(cameraInWaitTime));

            //Lets tsart the game
            stateMachine.ChangeState(GameplayStateMachine.GameplayState.Display);
        }
Exemplo n.º 5
0
        private IEnumerator ChangeState(GameplayStateMachine.GameplayState nextState)
        {
            if (nextState == GameplayStateMachine.GameplayState.GameOver)
            {
                yield return(UpdateHighScoreGameplay());
            }

            //wait a second to give the user time
            yield return(new WaitForSeconds(1.5f));

            //remove numbers on UI
            stateMachine.TriggerHUDEvent(UIEvents.Type.RemoveCombination, combinationFadeOutTime.ToString());
            //fade out combination
            yield return(new WaitForSeconds(combinationFadeOutTime));

            //TO Next State
            stateMachine.ChangeState(nextState);
        }
Exemplo n.º 6
0
 /// <summary>
 /// when the replay game button is selected
 /// </summary>
 /// <param name="message"></param>
 private void ReplayGame(string message)
 {
     stateMachine.PlaySound(AudioFiles.UISoundClip.CartoonPop);
     stateMachine.ChangeState(GameplayStateMachine.GameplayState.Replay);
 }