Beginning Game Development: Making a Boss Alien for the final fight in the game

Lem Apperson
3 min readMar 27, 2023

--

Concept art of an Boss Space Alien coming in for the attack.

In this article, we will explore the process of crafting a Boss Alien for a 2D shooting game set in space using Unity3D and C#. The boss alien is a critical component of any shooting game, and its design and behavior can make or break the game’s success. So let’s dive in!

First, let’s create a new game object in Unity3D and name it “BossAlien.” We will add a 2D sprite to this object and then write a script in C# to control its behavior. In this script, we will include the following controls:

Movement: The boss alien should move horizontally from left to right and back again. To achieve this, we will use the transform.position property of the game object to move it left or right by a certain distance. We will also use a boolean variable to determine whether the boss alien is moving left or right.

Here’s a short script segment to control the movement of the boss alien:

Shooting: The boss alien should also shoot at the player periodically. To achieve this, we will use a coroutine function to fire a projectile at the player every few seconds. We will also use a prefab object to instantiate the projectile.

Here’s a short script segment to control the shooting behavior of the boss alien:

Health: Finally, the boss alien should have a certain amount of health that decreases when it is hit by a projectile. We will use a health variable to track the boss alien’s health and a OnCollisionEnter2D function to detect when it is hit by a projectile. When the health variable reaches zero, the boss alien should die and the game should end.

Here’s a short script segment to control the health of the boss alien:

With these controls in place, we have successfully created a boss alien for our 2D shooting game set in space. This is just the beginning, however. There are many more features and behaviors that we can add to make the boss alien even more challenging and engaging for players.

--

--

Lem Apperson

Seeking employment using Uniy3D software solutions. Learning C++ and Unreal to expand my skills.