now that we have a game with a build , we will want to be able to quit it. this is done through “Application.Quit” the code can look like this:

I added the debug log in there so you can see it is recognised within the console as you can not quit while testing within unity.

Just like before within building settings we want to select “WebGL” and we want to “switch platform” to rebuild our project so that it can be built

Build Settings

Once this is done the Unity symbol will be next to the appropriate platform. We then want to resolve the warning related to the colour spacing within the build. You can find this within the player settings > Player > Other Settings Colour Space, this needs to be chnaged to Gamma for WebGL.

Now that all the main elements of the game are finished we can turn our game into executable file to test. This is done through the build settings under file.

Build settings

Within the player settings we can adjust whether it is windowed or full screen. Under play settings we can also adjust the type of full screen mode you would like. Once all settings are set you can run the exe. very simple and you can see all the platform you are able to use. Just have to have that module installed.

To get sound effects within your project you will have to add a new component ”Audio Source”

Audio Source Component

now having this on our player we can begin to code it within the script. we can start by storing the sound in a variable.

Lets start by adding an empty object and naming it Audio Manger. Then adding a child to it called background.

to the background we will add a component called “Audio Source” this communicates with the Main cameras component called “Audio Listener”

With the Post process volume Profile set we can now add our effects.

Effects that can be added

From the list I have added Bloom and Color grading

To add Post processing to our game we need to install it from the Package manager which we can find in the window tab.

To then get started we will want to add an empty GameObject that will define our profile that will control all the effects that we want to apply to our project. Then add the component “Post Process Volume”

Like our previous animation for the enemy lets add some animation our player when they are damaged.

Damaged Player

Like with our enemy ship animation we can add our sprites to the dope sheet like so:

Like we have done before we can drag and drop our png straight on to the dope sheet of the Animation Tab

Animator and Animation Tab

within the animator we will want to add a new empty state to separate the animation sequence of the enemy.

When building a game in unity it is done in a modular way. At the moment with our space shooter we have been working with one scene. If the game ends we would want to reload that scene, here's how:

Like the Game over text we will add some more text to read “Press the ‘R’ key to restart the level”

Create an empty object called “Game_Manger” and attach a C# script to also called “GameManager” Unity will recognise this and change the logo to a cog.

George Asiedu

Aspiring Unity Developer

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store