Objective: Our next feature will be a homing missile for the player with a powerup to pick up.

I will have the player hold a maximum of three missiles with each powerup they collect, providing one. Also, I’ll have the player fire a missile by pressing the “x” key.

First, I need to add some new variables to the UIManager script.

Next, in the UIManager, I create a UpdateMissileCount() method to update the missile count on the UI. This also checks if the missile count is below 0 or above 3 and resets to those min or max values.

Brian Branch

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