aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormiakata <miakata@gmail.com>2019-04-27 22:51:19 +0200
committermiakata <miakata@gmail.com>2019-04-27 22:51:19 +0200
commit87c702bbff7e39066c1aea6ed40c46a961a022d4 (patch)
tree74324c7f9dcfdd75fec8f66b1df0557799f3e9d4 /nGJ2019/Assets/Scripts/LevelScrolling.cs
parentc34eb93d97ae8dcb51ef88dc9ddae5b40c81783e (diff)
parent932a418c3f2251d434b67d115aaa380b51685ef7 (diff)
Merge branch 'master' of https://github.com/marcinzelent/ngj2019
Diffstat (limited to 'nGJ2019/Assets/Scripts/LevelScrolling.cs')
-rw-r--r--nGJ2019/Assets/Scripts/LevelScrolling.cs4
1 files changed, 2 insertions, 2 deletions
diff --git a/nGJ2019/Assets/Scripts/LevelScrolling.cs b/nGJ2019/Assets/Scripts/LevelScrolling.cs
index fac0a13..7ca89e3 100644
--- a/nGJ2019/Assets/Scripts/LevelScrolling.cs
+++ b/nGJ2019/Assets/Scripts/LevelScrolling.cs
@@ -49,7 +49,7 @@ public class LevelScrolling : MonoBehaviour
Background.localScale = new Vector3(finalHeight, finalHeight, 1);
var viewportX = Camera.main.ViewportToWorldPoint(new Vector3(0, 1, 0)).x;
- Background.position = new Vector3(viewportX * -1, 0, 0);
+ Background.position = new Vector3(viewportX * -1, 0, 10);
initialBgPos = Background.position;
}
@@ -63,7 +63,7 @@ public class LevelScrolling : MonoBehaviour
void DestroyObstacles()
{
- if (Obstacles[0].transform.position.x < -30)
+ if (Obstacles.Count > 0 && Obstacles[0].transform.position.x < -30)
{
Destroy(Obstacles[0]);
Obstacles.RemoveAt(0);