Making A 2D Shooter — More Power

Joshua Nielsen
3 min readDec 6, 2021

Adding new powerups to the game for greater variety

Photo by Pixabay from Pexels

The next step in taking this 2D shmup to the next level is to work on the powerups. The game already has some good powerups: speed, triple shot, and shield. That’s a really good starting point with great variety in effects, but the game is capable of more. Let’s take a look.

Refilling The Tank — The Ammo Powerup

Photo by Skitterphoto from Pexels

If you had read the previous article on changes to the player, you might have guessed that this was coming. Having already changed the player to have a limited amount of weapon shots, a way to restore their ammo was needed. Otherwise, the player would be very quickly helpless against the enemies.

The powerup does exactly what you think it would — it resets the player’s ammo variable to its maximum value.

Auto Mechanic — The Health Powerup

Photo by Pixabay from Pexels

Another thing that players might be interested in restoring is their health/lives. As things stand currently, players can take three hits from enemies before game over. With this new powerup, the player can restore one lost health.

Like with the ammo powerup, this powerup interacts with the player object to adjust the value of a variable. But while the ammo powerup restores the variable to a certain preset value every time, this powerup increases the value by just one but only if it is already below its maximum value.

Heavy Artillery — The Missile Powerup

Photo by Boris Hamer from Pexels

The missile powerup is similar to the triple shot in that it changes the way the player attacks. This powerup, powerup, even changes the appearance of the player’s shots. Instead of being “lasers”, the shots are now missiles. In addition to that, the missiles actually home in on enemies to destroy them. This is a very powerful powerup, and is very rare to spawn as a result.

Within Unity, missiles have their own unique script. They evaluate the collection of currently active enemies and determine which is the closest. Then they determine the direction of that particular enemy in relation to the missile itself. As the missile moves, it will rotate in order to be oriented in its target’s direction.

Trojan Horse — The Anti-Ammo “Powerup”

Photo by KEMAL HAYIT from Pexels

This powerup is different because it’s actually a powerdown. This will help keep the players on their toes, not being able to confidently grab every powerup that they come across.

As you might guess, this powerup completely drains the player’s ammo. This can be absolutely devastating when collected at the wrong time.

Within the script, this powerup operates exactly the same as the regular ammo powerup, except it sets the ammo value to zero instead of the maximum.

What’s Next

That covers our new powerups. Next time, we’ll see how the game’s user interface has changed. Thanks for reading.

--

--