예제 #1
0
    void Update()
    {
        //The user lost. Teach them a lesson!
        if (lose == true)
        {
            loseScreen.SetActive(true);
            //audioScript.PlaySound("Wrong Price");
            //StartCoroutine(door.openDoor(.2f));

            //Values below are for regular programmed game. Above is for itch.io since movies don't play (out of my control).
            StartCoroutine(failVideo.PlayThenDestroy(7));
            StartCoroutine(door.openDoor(7));
            lose = false;
        }
    }
예제 #2
0
    //Submit guess method.
    public void SubmitGuess()
    {
        userHash = new HashSet <int>(userArray.usersArray);
        compareArraysForExactMatches();
        compareForAnyMatches();
        numberCorrectButInWrongSpot = totalNumberCorrect - numberExactlyCorrect;
        //You win and got 4 correctly inthe right spot. Now play the win video for them!
        if (numberExactlyCorrect == 4)
        {
            //audioScript.PlaySound("Tada");
            // Code changed below since itch.io won't accept videos.

            StartCoroutine(successVideo.PlayThenDestroy(4f));
            StartCoroutine(door.openDoor(4f));
            //StartCoroutine(winScreen.displayTheScreen(2f));
            winScreen.SetActive(true);
        }

        if (showFirstRow == true)
        {
            displayNumberCorrectButInWrongSpot();
            displayNumberExactlyCorrect();
            showFirstRow  = false;
            showSecondRow = true;
        }
        else if (showSecondRow == true)
        {
            displayNumberCorrectButInWrongSpot2();
            displayNumberExactlyCorrect2();
            showSecondRow = false;
            showThirdRow  = true;
        }
        else if (showThirdRow == true)
        {
            displayNumberCorrectButInWrongSpot3();
            displayNumberExactlyCorrect3();
            showThirdRow  = false;
            showFourthRow = true;
        }
        else if (showFourthRow == true)
        {
            displayNumberCorrectButInWrongSpot4();
            displayNumberExactlyCorrect4();
            showFourthRow = false;
            showFifthRow  = true;
        }
        else if (showFifthRow == true)
        {
            displayNumberCorrectButInWrongSpot5();
            displayNumberExactlyCorrect5();
            showFifthRow = false;
            showSixthRow = true;
        }
        else if (showSixthRow == true)
        {
            displayNumberCorrectButInWrongSpot6();
            displayNumberExactlyCorrect6();
            showSixthRow   = false;
            showSeventhRow = true;
        }
        else if (showSeventhRow == true)
        {
            displayNumberCorrectButInWrongSpot7();
            displayNumberExactlyCorrect7();
            //showSeventhRow = false;
            //showEighthRow = true;
        }
        //else if (showEighthRow == true)
        //{
        //    displayNumberCorrectButInWrongSpot8();
        //    displayNumberExactlyCorrect8();

        //}

        if (numberExactlyCorrect == 4)
        {
            allCorrect = true;
        }

        //reset ALL values.
        numberExactlyCorrect = 0;

        totalNumberCorrect          = 0;
        numberCorrectButInWrongSpot = 0;
        removeElement0 = false;
        removeElement1 = false;
        removeElement2 = false;
        removeElement3 = false;

        moveSButton.moveButton();
        userArray.usersArray[0] = 1;
        userArray.usersArray[1] = 1;
        userArray.usersArray[2] = 1;
        userArray.usersArray[3] = 1;
    }