Currently, our project is setup to build for Windows. To change this we need to go to File > Build Settings. Select WebGL and then click ‘Switch Platform’.
Once we’ve saved everything, we can go to File > Build Settings. In here we want to make sure that we have our Main Menu set to scene 0 and our Game, or first level at least, set to scene 1.
We click on Player Settings and under ‘Player’ change the resolution and screen mode settings to be suitable for our test. We need to remember we have no built-in way to quit the game yet so it’s best to run Windowed.
First we need to add an audio source to the Player object. We also want to uncheck ‘Play On Awake’ as we need to script when sounds are played.
We’ll start by adding an empty gameobject called AudioManager. This will eventually handle scripting for audio events but for now it will house another child object called Background.
In the previous article we set up post processing for our project. We can now start adding effects. The first one we will add is Bloom. On our PostProcessingVolume, click ‘Add effect…’ and add Bloom.
First up we need to add the Post Processing package. We can simply go to Window > Package Manager then search for Post Processing. Click Install and wait for the installation to complete.
We start out by adding our fire object as a child of the Player, rename it Right_Damage, adjust the scale and position, and set the Sorting Layer to Foreground and give it a higher Order in the layer than the player.
First up, we’re going to be adding the animation to the enemy prefab so we open this up, go to the Animation tab then create a new animation.
We start by adding instructions to press ‘R’ to restart the game in the form of a new Text object which we set to appear when the player dies. See this article for more info on this.
We also add a new empty object called GameManager and a GameManager script to assign to it.