Shield Strength feature:

  • Visualize the strength of the shield. This can be done through UI onscreen or color changing of the shield.
  • Allow for 3 hits on the shield to accommodate visualization.

Steps

  1. Add a Scrollbar UI element and a Text element to the Canvas object. Set the correct position for these elements and rename the Text element to “Shield”.

--

--

Thrusters move the player at an increased speed when the ‘Left Shift’ key is pressed and return the player to normal speed when the ‘Left Shift’ key is released.

Receipt

  1. Write a condition that checks whether the left Shift key is pressed.
  2. If the left Shift key is depressed, increase the speed variable.
  3. Write a condition that checks if the left Shift key is pressed up.
  4. If the left Shift key is pressed up, set the speed variable to the default value.

Solution

--

--

Before you build your game in exclusive full-screen mode, you should first think about adding an exit feature to your application, otherwise there will be no way to exit the game or close the game window.

This is easy to do, just use the condition and check the input…

--

--

The option to upload and host games to the web gives us the ability to share games easily. It’s certainly much easier to send someone a URL link than a large file that you have to download first before you can run it.

To start publishing to the web, open “Build Settings” and change the platform to “WebGL”. Then click on “Switch platform to WebGL” and the project will recompile.

--

--

To make a game a complete creation and add excitement to it, you need to add music to it. Fortunately, in Unity it is easy to add background music to your project.

Adding background music

  1. Create a new empty object and name it ‘Audio_Manager’.
  2. Add to this object a child empty object and name it ‘Background’.
  3. Add to ‘Background’ object, an ‘Audio Source’ component.
  4. In ‘Audio Source’ component, add an audio file to the ‘AudioClip’ field and select ‘Play on Awake’ and ‘Loop’.

--

--

Damian Dąbrowski

Damian Dąbrowski

Hi, I’m Damian, a Unity Software Engineer who loves building education and simulation games.