Today, we will be creating our boss encounters that the player will face throughout the game. This was the final thing left to add to the game before build and release. I decided I wanted the game to continue until the player dies and kind of do a high score type of game. So I decided to scale up the difficulty of the game every five waves with a boss encounter.

First off, you will need your boss sprite and add the Rigidbody2D and Collider2D of your choice. Do our typical setup where the collider is a trigger and the…

Today we’re getting closer to wrapping up the Space Shooter game. In this article, we create a new enemy type that will move diagonally and shoot a triple shot laser. You will need to create a new enemy prefab as well as a new prefab of the triple shot. You will need to reposition the middle laser in the prefab so it doesn’t instantiate inside the player. We will also create a small offset to help prevent that from happening. …

Today, we will be creating a homing missile for the player to use against the enemies. First, find a sprite that you want to use for the missile, then add a BoxCollider2D on it and set it as a trigger. Then add a Rigidbody2d component and set the gravity scale to zero. You will also create a powerup for the missile just like we did all the other times before. We will need to prefab both of those game objects.

We’re going to create a new script for the homing missile and attach it to the missile prefab. …

In today’s article, we create an enemy that can shoot backward at the player if they get past them. I duplicated the base enemy and changed its appearance to look like there were guns on the tail of the ship. In our ‘Enemy’ script I created a new bool to distinguish if the enemy is the smart enemy.

In today’s article, we will give the enemy the ability to shoot and destroy powerups. To start this, we will open our ‘Enemy’ script and create a couple of new variables.

In this article, we create an enemy type that can dodge shots from the player.

To start we need to duplicate an enemy prefab and place it in the hierarchy. We will rename it as ‘Enemy_Dodge’. We will create an empty game object on it and call it ‘LaserDetector’. We will add a ‘Rigidbody 2D’ component as well as a ‘Polygon Collider 2D’ that is a trigger. Edit the collider of the polygon collider to look like a cone. This cone will act as the eyes of the enemy and allow them to see lasers coming at them.

In today's article, we will add a shield to an enemy at random. This system is quite simple but can cause a headache which I will explain at the end.

First, in the ‘Enemy’ script, we will be adding some variables.

In this article, we will be adding a new secondary fire powerup. I’m wanting to create a spray shot that will shoot three lasers. One laser will be shot forward, while two other lasers will be shot out diagonally from the left and right wings. Let’s get started.

Let’s create a new empty game object in the hierarchy and call it ‘Spray_Shot’. Let’s drag in three laser prefabs and make them children of the spray shot game object. …

Today I add on to the spawn manager and balance out some enemies. The technique I used is exactly as I did when I balanced the power-up up spawn system. Here is the article for that which explains some things better. In this article, I will be going through this fairly quickly since it’s the same principle.

First, I created a table for the weight of my enemy prefabs. I also made my ‘_enemy’ GameObject reference an array. And also created an int variable for the total weight of the enemy table.

It’s been about a week since my last article. I went on vacation with my family and now I’m ready to wrap up this project. Today I’m fixing a couple of tiny bugs that were bothering me. The first was when the player collected the health pickup when they already had full health. When this happened, the player had 4 lives instead of 3 as intended. The fix to this was in the ‘Player’ script at the ‘AddHealth’ function.

Chance Cornell

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