Beispiel #1
0
 private void Reset()
 {
     ScoreMgmt.IncreaseDeaths(gameObject.name);
     ScoreMgmt.DecreaseScore(gameObject.name, 25);
     gameMgmt.ShowScores(gameObject.name);
     gameMgmt.ShowDeaths(gameObject.name);
     transform.position = startPos;
 }
Beispiel #2
0
    void NextLevel()
    {
        ScoreMgmt.IncreaseLevel();

        if (runtimeScriptable != null)
        {
            runtimeScriptable.GetComponent <RuntimeScriptable>().CompileNextLevel();
        }
    }
Beispiel #3
0
    private void OnTriggerEnter2D(Collider2D collision)
    {
        if (collision.tag == "Death")
        {
            Reset();
        }

        if (collision.tag == "Pickup")
        {
            pickupCount++;
            ScoreMgmt.IncreaseScore(gameObject.name, pickupScore);
            gameMgmt.ShowScores(gameObject.name);
            gameMgmt.ShowDeaths(gameObject.name);
        }
    }
Beispiel #4
0
 public void ShowDeaths(string player)
 {
     if (player.Equals("Player2"))
     {
         if (p2Deaths != null)
         {
             p2Deaths.text = "P2 Deaths: " + ScoreMgmt.GetDeaths("Player2").ToString();
         }
     }
     else
     {
         if (p1Deaths != null)
         {
             p1Deaths.text = "P1 Deaths: " + ScoreMgmt.GetDeaths("Player1").ToString();
         }
     }
 }
Beispiel #5
0
 public void ShowScores(string player)
 {
     if (player.Equals("Player2"))
     {
         if (p2Score != null)
         {
             p2Score.text = "P2 Score: " + ScoreMgmt.GetScore("Player2").ToString();
         }
     }
     else
     {
         if (p1Score != null)
         {
             p1Score.text = "P1 Score: " + ScoreMgmt.GetScore("Player1").ToString();
         }
     }
 }
Beispiel #6
0
    void Update()
    {
        if (SceneManager.GetActiveScene().name != "Setup")
        {
            if (Input.GetKeyDown(KeyCode.Q))
            {
                GrammarGenerator.ClearString();
                GameObject.Find("LoadingText").GetComponent <Text>().text     = "Quitting";
                GameObject.Find("LoadingCam").GetComponent <Camera>().enabled = true;
                ScoreMgmt.ClearScores();
                ScoreMgmt.ClearDeaths();
                ScoreMgmt.ClearLevel();
                SceneManager.LoadScene("Setup");
            }
        }

        if (finishedPlayers == totalPlayers && totalPlayers != 0)
        {
            NextLevel();
        }
    }
Beispiel #7
0
 public void ShowLevel()
 {
     levelCount.text = "Level " + ScoreMgmt.GetLevel();
 }
Beispiel #8
0
 public void AddPoints(int points)
 {
     ScoreMgmt.IncreaseScore(gameObject.name, points);
     gameMgmt.ShowScores(gameObject.name);
     gameMgmt.ShowDeaths(gameObject.name);
 }