Quantcast
Channel: Questions in topic: "javascipt"
Viewing all articles
Browse latest Browse all 1875

How would I load a new scene when a score that is scored in a string is reached?

$
0
0
This is a code that I am working on for a space shooter. Part of it works and my score does increase by 7 every second but my script does not load my scene when the number reaches 1000. I have made sure that my scene is a part of my build settings and I have tried some fixes but it doesn't load even though I don't get any sort of error. Any Ideas? #pragma strict function Start(){ InvokeRepeating("EachSecond",1.0,1.0); } var score: int = 0; var addscore = 7; function EachSecond() { score=score+addscore; } function OnGUI(){ GUI.Box(Rect(1000,10,100,25), score.ToString()); } function WinningScore() { if (score >= 1000 ) { Application.LoadLevel("Win"); } }

Viewing all articles
Browse latest Browse all 1875

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>