x


Add time score to my game

Can someone please tell me how to add timer so if it goes to 0 its game over Also how can i add score so if for example i kill a robot in my game i get 300 points\

Thank you

more ▼

asked Mar 07 '11 at 08:48 AM

NorJay gravatar image

NorJay
15 4 4 10

(comments are locked)
10|3000 characters needed characters left

1 answer: sort voted first

Check out this link for a simple countdown timer script.If you have any experience with programming at all, this should be easy to follow.

http://answers.unity3d.com/questions/42818/problem-with-countdown-timer

Adding simple event based scores are easy, You could have an integer say, int PlayerScore and everytime you kill an enemy increment the variable by whatever you want.

Eg:

int PlayerScore = 0;

void EnemyDead()

{

//Write the logic for what happens when your enemy dies - animation, effects etc

PlayerScore += 300; //This means that 300 points will be added to the players score everytime the enemy dies.You can print this result using the GUI system. }

Hope this helps!`

more ▼

answered Mar 07 '11 at 09:40 AM

Sriram gravatar image

Sriram
213 9 10 19

(comments are locked)
10|3000 characters needed characters left
Your answer
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:

x573
x274

asked: Mar 07 '11 at 08:48 AM

Seen: 1018 times

Last Updated: Mar 07 '11 at 08:48 AM