Game: Reset speed on game start, not only on play again

parent 3671c4b2
...@@ -37,7 +37,6 @@ public class GameOver : MonoBehaviour ...@@ -37,7 +37,6 @@ public class GameOver : MonoBehaviour
public void OnButtonPlayClicked() public void OnButtonPlayClicked()
{ {
GameController.Speed = GameController.InitialSpeed;
SceneManager.LoadScene("Main"); SceneManager.LoadScene("Main");
} }
......
...@@ -22,6 +22,7 @@ public class UIController : MonoBehaviour ...@@ -22,6 +22,7 @@ public class UIController : MonoBehaviour
void Start () void Start ()
{ {
GameController.Speed = GameController.InitialSpeed;
_player = GameObject.FindWithTag("Player").GetComponent<Player>(); _player = GameObject.FindWithTag("Player").GetComponent<Player>();
HighScore.text = " "; // Keep position of elements, even when not displaying this one HighScore.text = " "; // Keep position of elements, even when not displaying this one
_oldHs = PlayerPrefs.GetInt("highscore"); _oldHs = PlayerPrefs.GetInt("highscore");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment