- Home /
Question by
darkwolf706 · Jun 22, 2015 at 10:49 AM ·
how togame overtitlehealth
How do I add a game over screen on my Javascript?
So I have a Javascript for my player's health, the problem is when the character "dies", it goes on a blank screen, and I have to manually shut down the game. I want to set it up so that when I die it says game over. Here's my script, I had to put the () between the number sign because it would be bold without it.:
(#)pragma strict
var Health = 100;
function ApplyDammage (TheDammage : int) { Health -= TheDammage;
if(Health <= 0)
{
Dead();
}
}
function Dead() { Destroy (gameObject); }
Comment