예제 #1
0
    // Increase the bounce count
    public void increaseBounceCount()
    {
        // If the colour switch count is less than 2
        if (colourSwitchCount < 2)
        {
            // Add 2 to the player's score
            setBounceCount(getBounceCount() + 2);

            // Spawn the alert text
            hudLayerController.getGameplayHUDLayer().printAlertText("Switch Bonus");
        }

        // Otherwise
        else
        {
            // Add 1 to the player's score
            setBounceCount(getBounceCount() + 1);
        }

        colourSwitchCount = 0;
        hudLayerController.getGameplayHUDLayer().updateHUDElements();

        // If the bounce count is equal to the target
        if (bounceCount >= ScoreTargetController.getScoreTarget())
        {
            // End the game
            ScoreTargetController.setCanGenerateScoreTarget(true);
            PlayerStatsContainer.setWins(PlayerStatsContainer.getWins() + 1);
            StartCoroutine(GameStateController.endGame());
        }
    }
예제 #2
0
    // Generate score target
    public static void generateScoreTarget()
    {
        if (canGenerateScoreTarget == true)
        {
            scoreTarget = Random.Range(minScoreTarget, maxScoreTarget);

            // Add to the score target based on the current round
            scoreTarget += scoreIncreaseModifier * (PlayerStatsContainer.getWins());
        }
    }
예제 #3
0
    // Show this layer
    public void show()
    {
        Cursor.visible = true;

        toolTipText.text = string.Empty;
        animComp.SetBool("isShowing", true);

        // Add on click listener
        quitButton.onClick.AddListener(delegate
        {
            musicPlayer.fadeOut();
            StartCoroutine(transitionToMainMenu());
        });

        winsText.text = PlayerStatsContainer.getWins().ToString() + " / " + StageSystemManager.getFinalStage().ToString();
        rankText.text = StageSystemManager.getPlayerRank(PlayerStatsContainer.getWins());
    }