2D Game Dev Journey — Day 13: Bug Fixes and Quitting
Welcome to 2D Game Dev Journey — Day 13: Bug Fixes and Quitting. Today I will be fixing bugs that I have noticed, as well as adding in a “Quit Application” functionality.
Starting Point & Setup
Today we will be starting right where we left off in 2D Game Dev Journey — Day 12: Deploying our Game.
Explosion Bug Fix
When it came to explosions, you may notice that as they occur, a laser I shot off will still be destroyed even though it doesn’t make too much sense as to why it would. One would expect the laser to go right through the explosion. This can be seen with the asteroid explosion in the above GIF, and it is something that also happens with the enemies. To fix this, I simply destroyed the colliders on the GameObjects once they are hit by a laser for the first time. This gives the following result:
Pause/Quit Application Functionality
I also decided to add a pause screen where a player can choose to either continue the game after a break or quit the game altogether. I implemented this through the use of the ESCAPE key. The first thing I did to get this going was set up my pause screen UI, which I show below:
After that, I implemented the functionality to bring up the pause menu, and to continue the game or quit the game, depending on whatever button the player selected.
Thanks for checking in and reading today’s article. Tomorrow, I will be adding a few more things to the game to help with the fun. As always, comments and critiques are welcome. If I have made any mistakes, please let me know so I can correct them for future readers. If you would like a more in-depth tutorial about anything I went over today, let me know and I will take the time to write something up.