Burst Fire Homing Missile, Ammo Count, Healing.

PieceofPhie
3 min readApr 17, 2021

Ive added a secondary ability to the player that will unleash a barrage of missiles. This ability is activated by pressing the 1 key.

Abilities

There will be a total of four abilities per ship that is activated using the 1–4 keys. Most of the planned abilities will have limited use and will only be usable again once refilled.

Place Holder UI to show how much ammo is left

Ammo Refills and Health

Ammo Refill
Health Refil

Ammo and Health refills will behave the same way as our power ups. They’ll spawn randomly, move downward, and destroy itself when off screen.

Overview

Each ship will have its separate script so i wont over bloat our current player script. So most of the abilities will be hard coded in.

Whats happening here is that ive created a new function that’ll check for the user’s 1–4 input. For now, we only have 1 as an input.

When the user presser 1, it’ll instantiate a new projectile game object and update the ammo UI and ammo int variable accordingly.

Ammo Refill

When our ammo game object collides with our player. our ammo will be reassigned to its original amount of ammo we started with. We use another variable called Ammoref1 to store that information during Start().

Once the reassignment is done, our call a function within our ui manager to update our UI accordingly.

Health/Healing

When our healing orb is collided with our player. It’ll call a function within player script that will increment the players health and update the UI.

The players health will never be incremented past its max health of 3. If it is, then our method will simple assign the player’s health to 3 to correct it.

Sign up to discover human stories that deepen your understanding of the world.

Free

Distraction-free reading. No ads.

Organize your knowledge with lists and highlights.

Tell your story. Find your audience.

Membership

Read member-only stories

Support writers you read most

Earn money for your writing

Listen to audio narrations

Read offline with the Medium app

PieceofPhie
PieceofPhie

Written by PieceofPhie

Unity Developer Based out of California

No responses yet

Write a response