Commit 246d439f by Raphael

Fixed

parents 17e881dd 3671c4b2
No preview for this file type
......@@ -8,7 +8,8 @@ namespace Assets.Scripts
public class GameController : MonoBehaviour
{
public static int PoolSize = 256;
public static float Speed = 4f;
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<SpriteRenderer>().sprite.bounds.size;
tra = BG.GetComponent<Transform>();
Screen.orientation = ScreenOrientation.LandscapeLeft;
Screen.autorotateToLandscapeRight = true;
Screen.autorotateToLandscapeLeft = true;
Screen.orientation = ScreenOrientation.AutoRotation;
}
void Update()
......
......@@ -20,6 +20,9 @@ public class GameOver : MonoBehaviour
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");
}
......
......@@ -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;
}
......
......@@ -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
......
......@@ -23,7 +23,7 @@ public class UIController : MonoBehaviour
void Start ()
{
_player = GameObject.FindWithTag("Player").GetComponent<Player>();
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];
}
}
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