Ejemplo n.º 1
0
 // Update is called once per frame
 void Update()
 {
     score1.text = ScoreHandler.GetInstance().GetScore(1) + "";
     score2.text = ScoreHandler.GetInstance().GetScore(2) + "";
     score3.text = ScoreHandler.GetInstance().GetScore(3) + "";
     score4.text = ScoreHandler.GetInstance().GetScore(4) + "";
 }
Ejemplo n.º 2
0
 public void ExitStage()
 {
     for (int i = 0; i < birds.Length; i++)
     {
         ScoreHandler.GetInstance().SetScore(i, 0);
     }
 }
Ejemplo n.º 3
0
 private void UpdateText()
 {
     for (var i = 0; i < playerCount; i++)
     {
         int score      = ScoreHandler.GetInstance().GetScore(i);
         int multiplier = ScoreHandler.GetInstance().GetComboCount(i);
         uiHolder[i].UpdateScore(score, multiplier);
     }
 }
Ejemplo n.º 4
0
 void OnCollisionEnter(Collision collision)
 {
     if (collision.gameObject.tag == "Player")
     {
         ScoreHandler sh = ScoreHandler.GetInstance();
         sh.UpdateScore(this.myScore);
         Destroy(gameObject);
     }
 }
Ejemplo n.º 5
0
    private void ScoreChanged()
    {
        int highestScore = 0;
        int player       = 0;

        for (int i = 0; i < birds.Length; i++)
        {
            int score = ScoreHandler.GetInstance().GetScore(i);
            if (score > highestScore)
            {
                highestScore = score;
                player       = i;
            }
        }

        if (mistress.input.GetControllerPort() != player + 1)
        {
            mistress.input.SetHackPortNumberModifier(player + 1);
            mistress.input.RedoBindings();
        }
    }
Ejemplo n.º 6
0
    private void PlayerScoreFeedback(float difference, int playerNumber)
    {
        if (difference < 0.15f)
        {
            floater.SetPulse(playerNumber, Grade.Perfect);
            ScoreHandler.GetInstance().IncrementCombo(playerNumber);

            int score = Mathf.FloorToInt(10 * ScoreHandler.GetInstance().GetComboMultiplier(playerNumber));
            ScoreHandler.GetInstance().AddScore(playerNumber, score * 10);

            if (ScoreHandler.GetInstance().GetComboCount(playerNumber) > 3)
            {
                GameObject.FindObjectOfType <CheerScript>().PlayCheerForExcellent();
            }
        }
        else if (difference < 0.3f)
        {
            floater.SetPulse(playerNumber, Grade.Great);
            ScoreHandler.GetInstance().IncrementCombo(playerNumber);

            int score = Mathf.FloorToInt(9 * ScoreHandler.GetInstance().GetComboMultiplier(playerNumber));
            ScoreHandler.GetInstance().AddScore(playerNumber, score * 10);
        }
        else if (difference < .8f)
        {
            int score = Mathf.FloorToInt(8 * ScoreHandler.GetInstance().GetComboMultiplier(playerNumber));
            ScoreHandler.GetInstance().AddScore(playerNumber, score * 10);


            floater.SetPulse(playerNumber, Grade.Good);
            ScoreHandler.GetInstance().IncrementCombo(playerNumber);
        }
        else
        {
            floater.SetPulse(playerNumber, Grade.Bad);
            ScoreHandler.GetInstance().SetComboCount(playerNumber, 0);
        }
    }
Ejemplo n.º 7
0
    private void DoScore()
    {
        for (int i = 0; i < birds.Length; i++)
        {
            if (!birds[i].IsInitialized())
            {
                continue;
            }

            PoseData currentPose = Pose.CalculateFromController(birds[i].GetInput());
            PoseData prevPose    = lastPose[i];

            //compare
            PoseDiff poseDiff = Pose.CalculatePoseDiffs(currentPose, prevPose);

            int randomScoreModifier = Random.Range(5, 10);
            int amount = Mathf.FloorToInt(poseDiff.totalDiff) * randomScoreModifier;
            ScoreHandler.GetInstance().AddScore(i, amount);

            lastPose[i] = currentPose;
        }
        ScoreChanged();
    }
Ejemplo n.º 8
0
    private static void ResetScene()
    {
        ScoreHandler.GetInstance().Reset();

        SceneManager.LoadScene(SceneManager.GetActiveScene().name);
    }