Exemple #1
0
    // Set-up
    void Start()
    {
        // If we are not in a gym destroy this component
        if (tScore == null)
        {
            Destroy(this);
        }

        gameModeMaster = GameObject.Find("GameModeMaster").GetComponent <GameModeMaster>();
        scorePopper    = this.transform.Find("ScorePopper").GetComponent <ScorePopper>();
        highScore      = GameObject.Find("PersonalHighScore").GetComponent <PersonalHighScore>();

        squatCardioScore = 0;
        tScore.text      = squatCardioScore.ToString();

        if (PlayerPrefs.GetInt(Constants.gameMode) == Constants.gameModeArcade)
        {
            arcadeMode = true;
            scoreConsecutiveCounter = 0;
            nextConsecutiveTarget   = FIRST_TARGET;
        }

        wallSoundEffects = this.GetComponent <WallSoundEffects>();

        //squatCounter = GameObject.Find("SquatWallCounterAchievments").GetComponent<SquatCounter>();
        SteamLeaderBoardUpdater = GameObject.Find("UpdateSteamLeaderBoard").GetComponent <SteamLeaderBoardUpdater>();

        // Get rid of the hand guard if we are not using it
        this.EnableDisableHands(cardioMode == false && gameModeMaster.GetHandGuard() == true);
    }
Exemple #2
0
    // Set-up
    void Start()
    {
        master = GameObject.Find("GameModeMaster").GetComponent <GameModeMaster>();

        walls[0] = Resources.Load <GameObject>("Walls/SquatWall");
        walls[1] = Resources.Load <GameObject>("Walls/SquatWallx2");
        walls[2] = Resources.Load <GameObject>("Walls/SquatWallx3");
    }
    // Set-up
    void Start()
    {
        master = GameObject.Find("GameModeMaster").GetComponent <GameModeMaster>();

        walls[0] = Resources.Load <GameObject>("Walls/CardioWallLeft");
        walls[1] = Resources.Load <GameObject>("Walls/CardioWallMid");
        walls[2] = Resources.Load <GameObject>("Walls/CardioWallRight");
    }
    /// <summary>
    /// Upload score and shrink/destroy this object
    /// </summary>
    public void UploadAndDestroy(string name)
    {
        LocalArcadeLeaderBoard localLB = GameObject.Find("LocalArcadeLeaderBoard").GetComponent <LocalArcadeLeaderBoard>();

        localLB.AddEntryAndShowPlacment(name, playerScore);
        growTimer = float.PositiveInfinity;
        shrink    = true;

        GameModeMaster gameMaster = GameObject.Find("GameModeMaster").GetComponent <GameModeMaster>();

        gameMaster.PreventLevelFromLoading = false;
    }
Exemple #5
0
    /// <summary>
    /// Destroy all walls and end the game
    /// </summary>
    public void EndGame(bool viaPauseMenu = false)
    {
        // If we have already done the ending stuff return out
        if (gameOver == true)
        {
            return;
        }

        //// If we are in classic mode, update the consecutive cardio
        //if (PlayerPrefs.GetInt(Constants.gameMode) == Constants.gameModeClassic)
        //{
        //	if (PlayerPrefs.GetInt(Constants.cardioMode) == 1)
        //	{
        //		// Check if we have reached any consecutive achievements and set stat
        //		AchivmentAndStatControl.SetStat(Constants.highestCardioConsec, squatCardioScore); // (Will only update stat if larger)
        //		AchivmentAndStatControl.CheckAllConsecutiveCardioAchivments(squatCardioScore);
        //	}
        //	else
        //	{
        //		AchivmentAndStatControl.SetStat(Constants.highestSquatConsec, squatCardioScore); // (Will only update stat if larger)
        //		AchivmentAndStatControl.CheckAllConsecutiveSquatAchivments(squatCardioScore);
        //	}
        //}

        // Save Score if in classic mode or if in daily challenge
        if (PlayerPrefs.GetInt(Constants.gameMode) == Constants.gameModeClassic || PlayerPrefs.GetInt(Constants.gameMode) == Constants.gameModeDaily)
        {
            SteamLeaderBoardUpdater.UpdateLeaderBoard(squatCardioScore);
        }

        // If arcade, update based on the score
        if (PlayerPrefs.GetInt(Constants.gameMode) == Constants.gameModeArcade)
        {
            // Save score to steam leader board
            int currScore = highScore.GetYourScore();
            SteamLeaderBoardUpdater.UpdateLeaderBoard(currScore);
            AchivmentAndStatControl.SetStat(Constants.highScore, currScore);

            // Dont enable the player score pop up
            if (viaPauseMenu == false)
            {
                // Pop up the name select
                ArcadeNameSelector nameSelector = GameObject.Find("ArcadeNameSelector").GetComponent <ArcadeNameSelector>();
                nameSelector.SetPlayerScore(currScore);
                nameSelector.SetToSize();
            }

            // Prevent loading level so we can pick name
            GameObject.Find("GameModeMaster").GetComponent <GameModeMaster>().PreventLevelFromLoading = true;
        }

        if (GameObject.Find("GYM") != null)
        {
            Transform st = GameObject.Find("GYM").transform.Find("SquatTrack");
            st.Find("SquatBars").GetComponent <GuideRail>().LowerRail();
            st.Find("DoorA").GetComponent <SquatTrackDoor>().CloseDoor();
            st.Find("DoorB").GetComponent <SquatTrackDoor>().CloseDoor();
        }

        // Disable hand block so it doesnt get in your way
        this.EnableDisableHands(false);

        // Gib all walls
        this.DestroyAllWalls(!viaPauseMenu);

        // Let the arcade mode handle ending the game if we are in arcade mode
        GameModeMaster gameMaster = GameObject.Find("GameModeMaster").GetComponent <GameModeMaster>();

        gameMaster.EndGame();

        gameOver = true;
    }