Today I am making it so the game can end by breaking out of the infinite loop. To do this first of all I had to create two new labels for the game over text and the restart text. I then created a new empty game object to parent the three label objects to clean up the hierarchy. After that I opened up my game controller script and proceeded to add the variables for the two new scripts and code to define them and give them their proper functions. I then went to the destroy by contact script so to add script to where the player ship can be destroyed, then added the script so that it would display the game over text and end the game when the player is destroyed and the current wave clears the screen. So now the game is a working playable piece of work. When the player is destroyed by the asteroid hazard the game over text will appear, then after the wave clears the player will be able to press the R key to restart the game and a prompt in the top right of the screen will be there to say so.
Current Destroy By Contact Script:
Current Game Controller Script:
Game Upon Reaching A Game Over:
What I Learned:
I learned how to call a script when certain circumstances are met and how to end an infinite loop within the game.
What I'm Doing Next Day:
Next day I will be building the games standalone launcher like the roll a ball game, and then I will move on to the first of the 2 long tutorials the extend this space shooter game.



No comments:
Post a Comment