What I Did:
Today I started by finishing up where I left off last day. The error from last day was a simple capitalization error which was an error on my end. The code that was effecting me was when i had error gameController.Addscore the s was capitalized on the game controller script when it was declared, so Addscore had no meaning when I put into the destroy by contact script. This was fixed by simply changing the line to gameController.AddScore. So after fixing that I returned to finishing the code needed to count the score. I also added a bit of insurance code to display a message in the console in case I happen to break the game in development. After that I dragged the Score Text game object to the game controller scripts reference slot for Score Text and set the score gained to 10 in the destroy by contact script both from unity. Now every time an asteroid is destroyed by the player the score is increased by 10 in the top left.
What I Learned:
I learned how to make an efficient score counter in a game that counts by whatever number I input and whenever I tell it to from in code/engine.
What I'm Doing Next Day:
Next day I'll be adding the game function of breaking out of the games infinite loop and ending the game presumably when the player is destroyed

No comments:
Post a Comment