Exemplo n.º 1
0
    // Use this for initialization
    void Start()
    {
        if (PlayerPrefs.GetInt(Constants.gameMode) != Constants.gameModeArcade)
        {
            Destroy(this.gameObject);
            return;
        }

        highScoreText = this.transform.Find("HighScoreNumber").GetComponent <TextMeshPro>();
        yourScoreText = this.transform.Find("YourScoreNumber").GetComponent <TextMeshPro>();

        highScoreText.text = AchivmentAndStatControl.GetStat(Constants.highScore).ToString();
        yourScoreText.text = currentScore.ToString();
    }
Exemplo n.º 2
0
    // Start is called before the first frame update
    void Start()
    {
        // Error message to be changed if we connect to steam
        string statSummary = "Error connecting to Steam stats, try relaunching Steam...";

        // If we connect to steam fill out with stats
        if (SteamManager.Initialized == true)
        {
            statSummary  = "Total Squat Walls Passed: " + AchivmentAndStatControl.GetStat(Constants.totalSquatWallCount) + "\n";
            statSummary += "Classic Mode Highest Consecutive Squats: " + AchivmentAndStatControl.GetStat(Constants.highestSquatConsec) + "\n";
            statSummary += "Total Cardio Walls Passed: " + AchivmentAndStatControl.GetStat(Constants.totalCardioWallCount) + "\n";
            statSummary += "Classic Mode Highest Consecutive Cardio Walls: " + AchivmentAndStatControl.GetStat(Constants.highestCardioConsec) + "\n";
            statSummary += "Number of Daily Challenges Completed: " + AchivmentAndStatControl.GetStat(Constants.totalDailyChallenges) + "\n";
            statSummary += "Number of Custom Routines Played: " + AchivmentAndStatControl.GetStat(Constants.totalCustomRoutines) + "\n";
            statSummary += "Punching Bag Hits: " + AchivmentAndStatControl.GetStat(Constants.punchingBagPunches) + "\n";
            statSummary += "Arcade Mode High Score: " + AchivmentAndStatControl.GetStat(Constants.highScore);
        }

        statText.text = statSummary;
    }
Exemplo n.º 3
0
    // Start is called before the first frame update
    void Start()
    {
        alpha = 1;
        if (this.transform.Find("Sprite") != null)
        {
            spriteRend = this.transform.Find("Sprite").GetComponent <SpriteRenderer>();
        }
        else
        {
            spriteRend = this.transform.parent.Find("Sprite").GetComponent <SpriteRenderer>();
        }

        if (forceUnlock == true && lockedUnlockedGloves.Length < 1)
        {
            unlocked          = true;
            descTexts[0].text = unlockedDescString;
            return;
        }

        button = this.GetComponent <CosmeticSelectionButton>();
        boxCol = this.GetComponent <BoxCollider>();

        if (displayProgress == true)
        {
            if (this.transform.Find("StatsOutOf") != null)
            {
                statOutOfText = this.transform.Find("StatsOutOf").GetComponent <TextMeshPro>();
            }
            else
            {
                statOutOfText = this.transform.parent.Find("StatsOutOf").GetComponent <TextMeshPro>();
            }
        }

        if (SteamManager.Initialized == true)
        {
            bool steamAch = false;
            SteamUserStats.GetAchievement(achivName, out steamAch);
            if (steamAch == true || forceUnlock == true)
            {
                unlocked          = true;
                descTexts[0].text = unlockedDescString;
                if (button != null)
                {
                    button.enabled = true;
                }
                if (displayProgress == true)
                {
                    statOutOfText.text = statMax + "/" + statMax;
                }
                spriteRend.sprite = lockedUnlockedSprite[1];
                lockedUnlockedGloves[0].SetActive(false);
                lockedUnlockedGloves[1].SetActive(true);
            }
            else
            {
                if (button != null)
                {
                    button.enabled = false;
                }
                if (boxCol != null)
                {
                    boxCol.enabled = false;
                }
                if (displayProgress == true)
                {
                    statOutOfText.text = AchivmentAndStatControl.GetStat(assocaitedStat) + "/" + statMax;
                }
                spriteRend.sprite = lockedUnlockedSprite[0];
                lockedUnlockedGloves[0].SetActive(true);
                lockedUnlockedGloves[1].SetActive(false);
            }
        }
    }
Exemplo n.º 4
0
    // If something hits the player
    void OnTriggerEnter(Collider other)
    {
        // For the normal game
        if (cardioMode == false)
        {
            // If its the Top of the wall reload level (Eventually explode boxes and show player high-score)
            if (other.name == "SquatWallUp")
            {
                this.CheckIfEndGame();
                mostRecentWallType = "Fail";                 // For sound Effects
            }
            // If its the bottom (squatted under the wall) increase the player score
            if (other.name == "SquatWallDown")
            {
                if (checkUp.Ready == true)
                {
                    squatCardioScore++;
                    tScore.text = squatCardioScore.ToString();

                    gameModeMaster.PassedThroughWall(false);

                    // Save the total stat and check for achievements
                    AchivmentAndStatControl.IncrementStat(Constants.totalSquatWallCount);
                    int totalSquatStat = AchivmentAndStatControl.GetStat(Constants.totalSquatWallCount);
                    if (totalSquatStat != -1)
                    {
                        AchivmentAndStatControl.CheckAllTotalSquatAchivments(totalSquatStat);
                    }

                    if (PlayerPrefs.GetInt(Constants.gameMode) == Constants.gameModeClassic)
                    {
                        AchivmentAndStatControl.SetStat(Constants.highestSquatConsec, squatCardioScore);                         // (Will only update stat if larger)
                        AchivmentAndStatControl.CheckAllConsecutiveSquatAchivments(squatCardioScore);
                    }

                    // If it is a normal sized squat wall make the player stand back up right away
                    if (other.transform.parent.parent == null || other.transform.parent.parent.name == "SquatWall(Clone)")
                    {
                        checkUp.Ready = false;

                        mostRecentWallType = "Single";                         // For sound Effects

                        if (arcadeMode == true)
                        {
                            scoreConsecutiveCounter += 10;
                            // Check if we got a combo, if we did it will display a combo, if not display what we just did
                            if (this.TestHighScoreConsecCounter() == false)
                            {
                                scorePopper.PopScoreMessage(0, .04f);
                                highScore.UpdateYourScore(10);
                            }
                            else
                            {
                                mostRecentWallType = "Combo";                                 // For sound Effects
                            }
                        }
                    }
                    else if (other.transform.parent.parent.name == "SquatWallx2(Clone)") // If squat wall is 2 long, allow 2
                    {
                        mostRecentWallType = "Double";                                   // For sound Effects
                        this.ResetAfterNumberOfWalls(2);
                    }
                    else                                                        // If squat wall is 3 long, allow 3
                    {
                        mostRecentWallType = "Tripple";                         // For sound Effects
                        this.ResetAfterNumberOfWalls(3);
                    }
                }
                else                 // Did not come up from a squat
                {
                    this.CheckIfEndGame();
                }
            }
        }
        else         // For cardio mode
        {
            // If the player hits the wall
            if (other.name == "CardioWallSolid")
            {
                this.CheckIfEndGame();
            }
            // If the player goes through the open spot
            if (other.name == "CardioWallOpen")
            {
                squatCardioScore++;
                tScore.text = squatCardioScore.ToString();

                if (arcadeMode == true)
                {
                    scoreConsecutiveCounter += 10;
                    // Check if we got a combo, if we did it will display a combo, if not display what we just did
                    if (this.TestHighScoreConsecCounter() == false)
                    {
                        scorePopper.PopScoreMessage(0, .04f);
                        highScore.UpdateYourScore(10);
                    }
                    else
                    {
                        mostRecentWallType = "Combo";                         // For sound Effects
                    }
                }

                gameModeMaster.PassedThroughWall(true);

                // Save the total stat and check for achievements
                AchivmentAndStatControl.IncrementStat(Constants.totalCardioWallCount);
                int totalCardioStats = AchivmentAndStatControl.GetStat(Constants.totalCardioWallCount);
                if (totalCardioStats != -1)
                {
                    AchivmentAndStatControl.CheckAllTotalCardioAchivments(totalCardioStats);
                }

                if (PlayerPrefs.GetInt(Constants.gameMode) == Constants.gameModeClassic)
                {
                    // 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);
                }
            }
        }
    }