Tuesday, February 18, 2014

Scores Managing system

Now that we have the basic component going we need to find a way to keep track of scores and time.
Since all the asset we made up until now can get destroy at some point (astroid get destroy when hit by bullet, Player get destroy when hit by astroid) etc. we need to make a new "object" to store the scores information  separately.

So I make an empty game object (which is pretty much an invisible object) and create new script for it and it will be our scores manager.
Scene manager Script

This code is pretty much telling the console to print the scores +1 every times bullet hit the astriod

 Then add this script to the bullet to tie them together.


Here is the result the console will tell us the scores every time we hit an enemy  

No comments:

Post a Comment