x


advanced countdown timer help please

i have basically designed a small game and would like a timer of 5 minuets to start up in the top right corner of the screen at the start of every level. i would also like this timer to record points for the player, if they complete the level with 4mins to spare they'll collect 400 points, 3mins to spare, 300 points, 2mins, 200 points and 1 minute to spare 100 points i would also like this timer to state game over and go back to the previous level to restart. i have been looking at numerous different codes and styles for weeks but i cant seem to make it do all this successfully. please could somebody help? any suggestions would be great

more ▼

asked Nov 23 '10 at 01:25 PM

crums gravatar image

crums
13 7 9 12

i have this as my coding right now. but i know its wrong and all its aiming to do there is count down 5 mins then take me to the end level. it still doesnt include the points scoring.

private var timer:int = 0;

function OnGUI() { GUI.Label("Timer"); } var myTimer : float = 300.0;

function Update () { if(myTimer > 0){ myTimer -= Time.deltaTime; } if(myTimer <= 0){ loadLevel("end"); } }

Nov 23 '10 at 04:44 PM crums
(comments are locked)
10|3000 characters needed characters left

0 answers: sort voted first
Be the first one to answer this question
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Topics:

x347
x62
x48

asked: Nov 23 '10 at 01:25 PM

Seen: 1103 times

Last Updated: Nov 23 '10 at 01:25 PM