diff --git a/Assets/Scripts/WaypointRace.cs b/Assets/Scripts/WaypointRace.cs index 0f3da87..af496e6 100644 --- a/Assets/Scripts/WaypointRace.cs +++ b/Assets/Scripts/WaypointRace.cs @@ -39,6 +39,7 @@ public class WaypointRace : MonoBehaviour script = player.GetComponent(); size = 2; level = 1; + script.lives = 3; script.finished = false; respawn(); script.pivot.transform.Rotate(0.0f, 225.0f, 0.0f, Space.Self); @@ -56,6 +57,7 @@ public class WaypointRace : MonoBehaviour { waypointPlacement(); + script.lives = 3; level++; if(level > 3) { @@ -74,9 +76,18 @@ public class WaypointRace : MonoBehaviour if(script.respawn == true) { respawn(); + script.lives--; script.respawn = false; } + if(script.lives == 0) + { + + script.lives = 3; + waypointPlacement(); + + } + if(countdown + completionTime < Time.time) {