diff --git a/Assets/Scenes/Main.unity b/Assets/Scenes/Main.unity index 29d9ebf..bde4ea7 100644 Binary files a/Assets/Scenes/Main.unity and b/Assets/Scenes/Main.unity differ diff --git a/Assets/Scenes/Scores.unity b/Assets/Scenes/Scores.unity index bfd56bc..21347c0 100644 Binary files a/Assets/Scenes/Scores.unity and b/Assets/Scenes/Scores.unity differ diff --git a/Assets/Scripts/GameController.cs b/Assets/Scripts/GameController.cs index 5a24480..40eac0b 100644 --- a/Assets/Scripts/GameController.cs +++ b/Assets/Scripts/GameController.cs @@ -7,8 +7,9 @@ namespace Assets.Scripts { public class GameController : MonoBehaviour { - public static int PoolSize = 256; - public static float Speed = 4f; + public static int PoolSize = 256; + public static float InitialSpeed = 4f; + public static float Speed = InitialSpeed; public GameObject Wall; public GameObject BG; @@ -23,7 +24,9 @@ namespace Assets.Scripts { size = BG.GetComponent().sprite.bounds.size; tra = BG.GetComponent(); - Screen.orientation = ScreenOrientation.LandscapeLeft; + Screen.autorotateToLandscapeRight = true; + Screen.autorotateToLandscapeLeft = true; + Screen.orientation = ScreenOrientation.AutoRotation; } void Update() diff --git a/Assets/Scripts/GameOver.cs b/Assets/Scripts/GameOver.cs index 9e6ac4f..46491e6 100644 --- a/Assets/Scripts/GameOver.cs +++ b/Assets/Scripts/GameOver.cs @@ -19,7 +19,10 @@ public class GameOver : MonoBehaviour public Button buttonPlay; void Start() - { + { + Screen.autorotateToLandscapeRight = true; + Screen.autorotateToLandscapeLeft = true; + Screen.orientation = ScreenOrientation.AutoRotation; } void Update () @@ -34,6 +37,7 @@ public class GameOver : MonoBehaviour public void OnButtonPlayClicked() { + GameController.Speed = GameController.InitialSpeed; SceneManager.LoadScene("Main"); } diff --git a/Assets/Scripts/HighScores.cs b/Assets/Scripts/HighScores.cs index dba67d0..dd14821 100644 --- a/Assets/Scripts/HighScores.cs +++ b/Assets/Scripts/HighScores.cs @@ -16,6 +16,9 @@ public class HighScores : MonoBehaviour { // Use this for initialization void Start () { + Screen.autorotateToLandscapeRight = true; + Screen.autorotateToLandscapeLeft = true; + Screen.orientation = ScreenOrientation.AutoRotation; ScoreText.text = ""; Server = gameObject.GetComponent(typeof(Server)) as Server; } diff --git a/Assets/Scripts/Menu.cs b/Assets/Scripts/Menu.cs index 80218c4..1a58a65 100644 --- a/Assets/Scripts/Menu.cs +++ b/Assets/Scripts/Menu.cs @@ -7,7 +7,9 @@ public class Menu : MonoBehaviour { // Use this for initialization void Start () { - + Screen.autorotateToLandscapeRight = true; + Screen.autorotateToLandscapeLeft = true; + Screen.orientation = ScreenOrientation.AutoRotation; } // Update is called once per frame diff --git a/Assets/Scripts/UIController.cs b/Assets/Scripts/UIController.cs index 3340d0a..7de9991 100644 --- a/Assets/Scripts/UIController.cs +++ b/Assets/Scripts/UIController.cs @@ -23,7 +23,7 @@ public class UIController : MonoBehaviour void Start () { _player = GameObject.FindWithTag("Player").GetComponent(); - HighScore.enabled = false; + HighScore.text = " "; // Keep position of elements, even when not displaying this one _oldHs = PlayerPrefs.GetInt("highscore"); } @@ -45,7 +45,7 @@ public class UIController : MonoBehaviour private void HandleScore() { if (_oldHs < _player.Score) - HighScore.enabled = true; + HighScore.text = "New high score!"; } private void HandlePowerUps() @@ -55,6 +55,5 @@ public class UIController : MonoBehaviour private void DisplayBattery() { Battery.sprite = BatteryImages[_player.Battery/8]; - Progression.sprite = ProgressionSprites[_player.Progression / 5]; } }