- Home /
Enemy kill counter and time limit.
I'm making a game about killing sentry turrets around the world, and there are a few things i'km not sure how to do...
-If you kill all 15 enemies, you advance to the end game level
-You have a GUI counter at the top of your screen that shows how many are dead, and how many there are in total I.E. 6/15 sentries.
-You have a 15 minute time limit and then your death animation plays
-when you die, 2 3d textures show up (restart and exit)
Thank you.
Lot of separate question here that will take separate answers. I recommending editing this question down to a single question and posting the others as their own question. Taking a shot at writing your own script to solve the problem first will often get you quicker and more accurate answers.
Answer by Tim-A · Mar 24, 2013 at 08:29 PM
I can help you with the first two.
You would have a 2 scripts,The first one would go on the enemy and have it send 1 death to the other script which counts it. Then you can have,
if(enemiesDead == 15) Application.LoadLevel("End Of Game");
Have a script that counts enemies death, and have it say,
GUI.Label (Rect (10, 10, 100, 20), enemiesDead + "/15");
it would loom like the amount of enemies dead and "/15".
I hope that helps you. If you have any questions comment please.
I'm confused on your second bit, I don't know how to write a script that counts enemy deaths or what to attach it to.
Ok, do you have a script that makes the enemies health go down and die?
yes I do. Do I attach that code to the script, or directly to the enemy?
Your answer
Follow this Question
Related Questions
Removing a GUITexture a set amount of time after it has been enabled. 1 Answer
how to make a highlight gui ?? 1 Answer
How to draw GUI Text from code 1 Answer
Count the Score 1 Answer
Minute Timer Issue 1 Answer