Objective: Add movement animations to the Player when pressing either the left or right arrows.

Step 1: In Unity, with the Player GameObject selected in the Hierarchy window, create an animation file for the left turn and another animation file for the right turn using the chopped-up Sprite animation images from FileBase.


Objective: Create a balanced spawn system for the power-ups using a weighted table where more common power-ups, like ammo and health, spawn more frequently, and rare power-ups, like the Laser Beam, spawn more infrequently.

Step 1: In the SpawnManager script, create a private int array called _table and set a value for each power-up from largest to smallest. The larger the value, the more often that power-up will spawn.


Objective: Create two custom classes and have one custom class inherit the properties of the other custom class.

Step 1: In Unity, within the Hierarchy window, create an Empty GameObject named Item_Database. In the Project window, create three C# Scripts called Item, Weapon, and ItemDatabase. Then drag the ItemDatabase script onto the Item_Database GameObject.


Objective: Create a custom Class for defining information about 3 customers to use within a customer database.

Step 1: In Unity, create an Empty GameObject in the Hierarchy window called Customer_Database. Then create a C# Script called CustomerDatabase and drag it onto the Customer_Database GameObject. Lastly, create another C# Script called Customer and open both scripts.


Objective: Create 5 positions that a GameObject will be randomly set to at the start of the game.

Step 1: Within Unity, create a Cube 3D GameObject in the Hierarchy window and rename it to Player. Then create a C# Script in the Project window called Player and attach it to the Player GameObject.


Objective: When pressing the space bar, damage the Player by a random amount and, using a Return Method, check if the Player has died. If the Player has died, print out “The Player has died!”, do not let the Player’s health drop below 0, and prevent that the space bar from causing more damage.

Step 1: In Unity, create a 3D Cube in the Hierarchy window and rename the cube to Player.


Objective: Change the color of a cube to red when the Space key is pressed by passing parameters from one method to another method.

Step 1: In Unity, create a 3D Cube in the Hierarchy window.


Objective: Fix a bug that causes the Enemy to detect and evade laser shots after a collision that triggers the explosion animation.

Step 1: In the Enemy script, within the DodgeLeft() coroutine, add to the while loop condition that both _collider1 and _collider2 must be enabled for the evade movement to take place.


Objective: When the Enemy detects a laser, depending on which Raycast picks up the detection, the Enemy will move to the left or right to evade the laser.

Step 1: Create an IEnumerator method called DodgeLeft(). Within this method create a Vector2 variable called _currentPos and have it equal to transform.position. Create another Vector2 variable called _destination and have that equal to a new Vector2 with the current transform position on the X-axis minus 1, and the current transform position on the Y-axis. Then create a float variable called _t and have it equal to 0.


Objective: Enemies that move straight down the Y-axis can detect laser shots made by the player.

Step 1: In Unity, select the Laser Prefab in the Project window and create a new Layer in the Inspector window called Laser.

Pete Thomasberger

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