Hi,
I need some help with getting my script to work for my lives system. I have already created 4 sprites showing all 3 lives to 0 lives. I need the player to lose a life if they score below the required amount of points (1500pts) or if they run out of time. This is what I have so far...can anyone help?
public class Lives : MonoBehaviour {
public int startingLives = 3;
public static int curLives;
// Use this for initialization
void Start () {
curLives = startingLives;
}
void OnLevelWasLoaded(int level) {
if (level == 08)
if (Score.score < 1500) {
curLives--;
}
else if (curLives < 0) {
print ("Game Over!");
guiText.text = "Game Over!" + curLives.ToString();
guiText.material.color = Color.black;
}
}
}
Any help is appreciated.
Thanks