예제 #1
0
    void Update()
    {
        if (strobeTimer > 0)
        {
            strobeTimer -= Time.deltaTime;

            if (strobeTimer <= 0)
            {
                StartCoroutine(dArrow.Strobe());
                dMan.bDialogueActive = true;

                // Sound Effect
                SFXMan.sounds[2].PlayOneShot(SFXMan.sounds[2].clip);
            }
        }

        // Change from first music track to second
        if (musicTimer1 > 0)
        {
            musicTimer1 -= Time.deltaTime;

            if (musicTimer1 <= 0)
            {
                mMan.SwitchTrack(1);
            }
        }
    }
예제 #2
0
    void Update()
    {
        if (strobeTimer > 0)
        {
            strobeTimer -= Time.deltaTime;

            if (strobeTimer <= 0)
            {
                StartCoroutine(dArrow.Strobe());
                dMan.bDialogueActive = true;

                // Sound Effect
                SFXMan.sounds[2].PlayOneShot(SFXMan.sounds[2].clip);
            }
        }
    }
예제 #3
0
    void Update()
    {
        // New Game -- Dialogue activation & strobe arrow start
        if (strobeTimer > 0)
        {
            // Script Pref -- Run uMan once after initial load in UIManager
            if (strobeTimer == 1f)
            {
                uMan.HideBrioAndButton();
            }

            strobeTimer -= Time.deltaTime;

            if (strobeTimer <= 0)
            {
                bOptModeSelect = true;
                StartCoroutine(dArrow.Strobe());
                dMan.bDialogueActive = true;
                sFaderAnimDia.transform.localScale = Vector3.zero; // Remove to allow mouse click on options prompts

                // Sound Effect
                SFXMan.sounds[2].PlayOneShot(SFXMan.sounds[2].clip);
            }
        }

        // Mode Selection Prompt
        if (bOptModeSelect &&
            !dMan.bDialogueActive)
        {
            GWC_PromptRestrictions();

            dialogueLines = new string[] {
                "First and first mostly, who's playing?"
            };
            GWC_DialogueResetter();

            optionsLines = new string[] {
                "Me (Single player)",
                "Us (Multiplayer)"
            };
            GWC_OptionsResetter_2Q();
        }

        // Begin play -- Activate music, UI, and fade after team selection
        if (!dMan.bDialogueActive &&
            !bAvoidUpdate &&
            bStartGame)
        {
            thePlayer.GetComponent <PlayerMovement>().bStopPlayerMovement = false;
            mMan.bMusicCanPlay = true;
            sFaderAnim.GetComponent <Animator>().enabled = true;

            // Change to avoid running this logic
            bAvoidUpdate = true;

            // Allow tile flipping
            StartCoroutine(StartFlipping());

            // Mode Reminders
            if (bOptModeMulti)
            {
                StartCoroutine(StartMulti());
            }
            if (bOptModeSingle)
            {
                StartCoroutine(StartSingle(1.0f));
            }
        }

        // Change from first music track to second
        if (bStartGame &&
            bAvoidUpdate &&
            musicTimer1 > 0)
        {
            musicTimer1 -= Time.deltaTime;

            if (musicTimer1 <= 0)
            {
                mMan.SwitchTrack(1);
            }
        }

        // Change from second music track to third
        if (musicTimer1 <= 0 &&
            musicTimer2 > 0)
        {
            musicTimer2 -= Time.deltaTime;

            if (musicTimer2 <= 0)
            {
                mMan.SwitchTrack(2);
            }
        }

        // Resetting
        if (!dMan.bDialogueActive &&
            bBoardReset &&
            !bCanFlip)
        {
            StartCoroutine(DelayedResetBoard());
        }

        // Zoom In -- Scroll Forward or press Y
        if (mainCamera.orthographicSize >= aUtil._wantedAspectRatio &&
            !dMan.bDialogueActive &&
            !pause.bPauseActive &&
            !pause.bPausing &&
            (Input.GetAxis("Mouse ScrollWheel") > 0 ||
             Input.GetKeyDown(KeyCode.Comma) ||
             Input.GetKeyDown(KeyCode.JoystickButton3) ||
             touches.bYaction))
        {
            mainCamera.orthographicSize = mainCamera.orthographicSize - 0.25f;
            touches.bYaction            = false;
        }

        // Zoom Out -- Scroll Back or press X
        if (mainCamera.orthographicSize < 5.642857f &&
            !dMan.bDialogueActive &&
            !pause.bPauseActive &&
            !pause.bPausing &&
            (Input.GetAxis("Mouse ScrollWheel") < 0 ||
             Input.GetKeyDown(KeyCode.Period) ||
             Input.GetKeyDown(KeyCode.JoystickButton2) ||
             touches.bXaction))
        {
            mainCamera.orthographicSize = mainCamera.orthographicSize + 0.25f;
            touches.bXaction            = false;
        }

        // Single Player - Reminder to Guess
        if (bSingleReminder &&
            !dMan.bDialogueActive)
        {
            bSingleReminder     = false;
            bAllowPlayerToGuess = true;

            GWC_PromptRestrictions();

            dialogueLines = new string[] {
                "And when you're ready, just hold down for a couple of seconds."
            };
            GWC_DialogueResetter();
        }

        // Single Player - Player Guess
        if (bAllowPlayerToGuess &&
            !dMan.bDialogueActive &&
            (Input.GetKey(KeyCode.Space) ||
             Input.GetKey(KeyCode.G) ||
             Input.GetKeyDown(KeyCode.JoystickButton4) ||
             Input.GetKeyDown(KeyCode.JoystickButton5) ||
             (Input.GetMouseButton(0) &&
              Input.touchCount < 2)))
        {
            buttonTimer += Time.deltaTime;

            if (buttonTimer >= guessThreshold &&
                !spLogic.bGuessingFTW)
            {
                if (spLogic.bPlayerMidGuess)
                {
                    spLogic.bPlayerGuessing = true;
                }
                else if (!bIsPlayerG2G)
                {
                    IsPlayerGoodToGuess();
                }

                buttonTimer = 0;
            }
        }

        // Single Player - Reset Player Guess timer
        if (Input.GetMouseButtonUp(0) ||
            Input.GetKeyUp(KeyCode.Space))
        {
            buttonTimer = 0;
        }
    }
예제 #4
0
    void Update()
    {
        if (strobeTimer > 0)
        {
            strobeTimer -= Time.deltaTime;

            if (strobeTimer <= 0)
            {
                StartCoroutine(dArrow.Strobe());
                dMan.bDialogueActive = true;

                // Sound Effect
                SFXMan.sounds[2].PlayOneShot(SFXMan.sounds[2].clip);
            }
        }

        if ((pause.transform.localScale == Vector3.one ||
             dMan.bDialogueActive) &&
            !bAvoidInvestionUpdate)
        {
            bAvoidInvestigating   = true;
            bAvoidInvestionUpdate = true;
        }

        // Avoid investigating when paused or dialogue up (w/ spacebar still down)
        if ((pause.transform.localScale == Vector3.zero &&
             !dMan.bDialogueActive) &&
            bAvoidInvestionUpdate)
        {
            if (Input.GetButton("Action") ||
                Input.GetMouseButton(0) ||
                contSupp.ControllerButtonPadBottom("hold") ||
                touches.bAaction
                )
            {
                // Avoid reseting the booleans until actionable is let up
            }
            else
            {
                bAvoidInvestigating   = false;
                bAvoidInvestionUpdate = false;
            }
        }

        if (bHasLost &&
            !bAvoidUpdate)
        {
            Lose();

            // Reset the bools
            bAvoidUpdate = true;
        }

        if (bHasWon &&
            !bAvoidUpdate)
        {
            Win();

            // Reset the bools
            bAvoidUpdate = true;
        }

        // Lose brio every X seconds while playing
        if (brio.playerCurrentBrio > 1 &&
            pause.transform.localScale != Vector3.one &&
            !dMan.bDialogueActive &&
            (!bHasLost || !bHasWon))
        {
            if (!warpMinesweeper.GetComponent <SceneTransitioner>().bAnimationToTransitionScene)
            {
                brio.FatiguePlayer(0.0025f);
                brio.bRestoreOverTime = false;
                uMan.UpdateBrio();
            }
        }

        // 06/06/2018 DC -- If out of brio, should the game end?
    }