Another feature to add to the player is lives to the shield through visually showing it by colour so it looks like the shield takes damage. We start by duplicating the shield within the hierarchy:
We then make these shields visually different within the inspector by changing colour or size, whatever suits the look you are going for. I went for colour.
To add a little more speed to the game, I have added a little boost to the player by adding an after burner. This will be done by re using the thruster animation and making it bigger when the Left shift key is pressed.
This is controlled in the hierarchy with another asset as a child to the player like so:
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
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.
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.
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.
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…