Commit 216c4891 by Raphael

Update

parent b4743506
No preview for this file type
...@@ -32,14 +32,10 @@ namespace Assets.Scripts ...@@ -32,14 +32,10 @@ namespace Assets.Scripts
Screen.height, 0)).x; Screen.height, 0)).x;
var leftBorder = Camera.main.ScreenToWorldPoint(new Vector3(0, 0, 0)).x; var leftBorder = Camera.main.ScreenToWorldPoint(new Vector3(0, 0, 0)).x;
if (!(rightBorder > (size.x*mult) - 2)) return; if (!(rightBorder > (size.x*mult) - 5)) return;
BG = (GameObject) Instantiate(BG, new Vector3(size.x + tra.position.x - .5f, tra.position.y, 0), Quaternion.identity); BG = (GameObject) Instantiate(BG, new Vector3(size.x + tra.position.x - .5f, tra.position.y, 0), Quaternion.identity);
tra = BG.GetComponent<Transform>(); tra = BG.GetComponent<Transform>();
mult++; mult++;
// _ca.Step(rightBorder);
// DrawMap(leftBorder, rightBorder);
// Debug.Log(_map);
} }
} }
} }
\ No newline at end of file
...@@ -39,8 +39,19 @@ public class UIController : MonoBehaviour ...@@ -39,8 +39,19 @@ public class UIController : MonoBehaviour
NbVials.text = _player.NbVials.ToString(); NbVials.text = _player.NbVials.ToString();
DisplayBattery(); DisplayBattery();
HandlePowerUps();
} }
private void HandlePowerUps()
{
if (_player.NbVials >= 5)
Vial1.enabled = true;
if (_player.NbVials >= 10)
Vial2.enabled = true;
if (_player.NbVials >= 15)
Vial3.enabled = true;
}
private void DisplayBattery() private void DisplayBattery()
{ {
Battery.sprite = BatteryImages[_player.Battery/8]; Battery.sprite = BatteryImages[_player.Battery/8];
......
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