private void Reset() { ScoreMgmt.IncreaseDeaths(gameObject.name); ScoreMgmt.DecreaseScore(gameObject.name, 25); gameMgmt.ShowScores(gameObject.name); gameMgmt.ShowDeaths(gameObject.name); transform.position = startPos; }
void NextLevel() { ScoreMgmt.IncreaseLevel(); if (runtimeScriptable != null) { runtimeScriptable.GetComponent <RuntimeScriptable>().CompileNextLevel(); } }
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); } }
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(); } } }
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(); } } }
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(); } }
public void ShowLevel() { levelCount.text = "Level " + ScoreMgmt.GetLevel(); }
public void AddPoints(int points) { ScoreMgmt.IncreaseScore(gameObject.name, points); gameMgmt.ShowScores(gameObject.name); gameMgmt.ShowDeaths(gameObject.name); }