Example #1
0
    // Update is called once per frame
    void Update()
    {
        cState = currentstate.state;
        switch (cState)
        {
        case CurrentState.State.Start:
            if (LeftHand.activeInHierarchy == true || RightHand.activeInHierarchy == true)
            {
                // starts the game if at least one hand is detected
                WaitingScreen.SetActive(false);
                currentstate.state = CurrentState.State.Begin;
            }
            break;

        case CurrentState.State.Begin:
            // displays a bit of context
            BeginScreen.SetActive(true);
            Invoke("BeginAct", 6);
            Invoke("Alphabet", 6);
            break;

        case CurrentState.State.Alphabet:
            // first puzzle : find the keyword on the stones and translate it thanks to the words on the walls
            BeginScreen.SetActive(false);
            roocoEnigma.SetActive(true);
            break;

        case CurrentState.State.Question:
            // second puzzle : find the answer on one of the suspended cardboards
            roocoEnigma.SetActive(false);
            girardetEnigma.SetActive(true);
            break;

        case CurrentState.State.Intrus:
            // third puzzle : zoom on the goat on the painting (the goat has been manually added and isn't present in the original painting)
            girardetEnigma.SetActive(false);
            intruderEnigma.SetActive(true);
            break;

        case CurrentState.State.Win:
            // player won
            intruderEnigma.SetActive(false);
            winState.SetActive(true);
            Invoke("ReloadScene", 20);
            break;

        case CurrentState.State.Loose:
            // player lost
            looseState.SetActive(true);
            roocoEnigma.SetActive(false);
            girardetEnigma.SetActive(false);
            intruderEnigma.SetActive(false);
            winState.SetActive(false);
            Invoke("ReloadScene", 20);
            break;
        }
    }
Example #2
0
 // Update is called once per frame
 // The player loses if the enigma isn't solved in due time.
 // Otherwise, display a new bubble every minute for the next five minutes.
 void Update()
 {
     cState = Player.GetComponent <CurrentState>().state;
     if (cState == CurrentState.State.Start || cState == CurrentState.State.Win)
     {
         //Freeze timer
     }
     else
     {
         timer -= Time.deltaTime;
         if (timer < 0)
         {
             FiveMin.SetActive(true);
             Player.GetComponent <CurrentState>().state = CurrentState.State.Loose;
         }
         else if (timer < 60)
         {
             FourMin.SetActive(true);
         }
         else if (timer < 120)
         {
             ThreeMin.SetActive(true);
         }
         else if (timer < 180)
         {
             TwoMin.SetActive(true);
         }
         else if (timer < 240)
         {
             OneMin.SetActive(true);
         }
         else if (timer < 300)
         {
             ZeroMin.SetActive(true);
         }
     }
 }
 // Start is called before the first frame update
 void Start()
 {
     cState = Player.GetComponent <CurrentState>().state;
 }
Example #4
0
 // Start is called before the first frame update
 void Start()
 {
     cState = currentstate.state;
 }