It’s time to add another unique type of enemy to my space shooter. You know what everybody loves? Tiny versions of normally-sized things. They’re just so cute. Using that logic, I made some tiny enemies! This is a new enemy type that spawns with two smaller enemies on each side…
Right now, my powerup spawning system works fine but I want to separate the ammo and health powerups from the rest of the group so I can tweak their spawn rates independently. I’d rather have the health spawn rarely and have the ammo spawn frequently.
I’ll work in the spawn manager script for this one, and I’ll create two new GameObject variables to reference the health and ammo prefabs. From there, I created a new coroutine specifically for health and ammo. At the beginning of the spawn loop, it creates a random number between 1 and 5. If it’s 1, it spawns health. Otherwise, it will spawn ammo. I’m making a call in the StartSpawning method to start this new coroutine so it will run in parallel with the others.
I want to make it easier for my player to collect powerups, and the best way to do that would to create some sort of functionality where the player can use a “magnet” to attract nearby powerups. This is pretty simple to implement.
Now that my shooter as a wave system, it is only natural that I put a boss level at the end. Before I do that, I need a boss character. I found some art that worked as a boss and created an object out of it.
Currently, enemies in my space shooter will spawn forever as long as the player is still alive. To change things up, I want to add a wave spawning system to the game where each wave will progressively spawn more enemies. Maybe later I’ll add a boss level to the end.
Here I am, knee-deep in my never-ending quest to add more stuff to my game. This time, I want to add shielded enemies that require an extra shot to destroy. Surprisingly, this will only take a small amount of code!
I started by copying the existing player shield object and…