Phase 1: Health Collectable

Objective: Add Health powerup and update UI when collected.

We will create the animated health powerup prefab the same way we did the ammo collectable in the previous post. We will also use the same logic to add the powerup script and add the powerup to the spawn manager following the modular system. We will set a new audio sound on the prefab in the powerup script and the main difference between this powerup and the ammo power up is, instead of updating the ammo text element we need to update the lives sprites to show the lives have increased. To do this we simple call the update lives method on the UI manager from the health powerup method and pass the players lives through.

Health powerup method

In the next post, we will create a new firing system for the player.