New Feature — Burst Shot Collectible

Objective: Providing the player with a secondary way to shot down the enemies with a Burst Power-up

Similar to the other power-ups: Health, Ammo, and Thruster, we are going to create another power-up that will enable the player to shoot lasers in multiple directions.

Create the Burst Power-up Prefab

Make a copy (duplicate) of the Ammo power up by selecting it and pressing CTRL + D and rename the new prefab to BurstPowerUp.

Let’s add the Burst to the Power type enum so we can select it as the Power Up type for the new prefab

The Burst Shoot prefab itself is simply a number of lasers set in their initial position and when the prefab is instantiated, the laser then starts its normal movement behaviour which is to move forward.

Next, we will code in the behaviour for when the player ship touches the power-up. It will activate the secondary fire for 5 seconds.

First, we call the method from the PowerUp script to activated the Burst fire.

The BurstShootActive sets the flag to true to enable the burst shot and starts the coroutine that sets the flag to false after 5 seconds.

The PlayerShoot script has a reference to the prefab.

During when the Burst is active, the Fire method fires off the burst prefab each time the fire button is pressed.

I finally drag the prefab to the Player Shoot script, add the Burst Power-up to the Spawn Manager and play the game.

If you enjoyed reading this article give me a Clap, also if you would like to see more, “Follow” me, so you may be notified of future releases. You may also send me a message if you need any further help.

--

--

--

A Data & Analytics Consultant who is expanding into developing experiences in XR, Enterprise and Gaming space using Unity www.jeannoelseneque.com

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

RAPIDS 0.7: Well We’re Moving On Up…

Profit from shortening links (5 practical steps to make profit 2021)

Evolution of Redash at Blinkit

Google Cloud Run on Rails: a real life example (Part 4: going live!)

《哆啦a梦伴我同行2》(STAND BY ME) — 完整版 — 完整版完整版 [[2020]]

Find Broken Links on a Website with Selenium WebDriver

Case Study of AWS SQS

15 Keys to Achieve Predictability Within your Team

How to become predictable and estimate better

Get the Medium app

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
Jean-Noel Seneque

Jean-Noel Seneque

A Data & Analytics Consultant who is expanding into developing experiences in XR, Enterprise and Gaming space using Unity www.jeannoelseneque.com

More from Medium

Zero Net Energy Affordable Housing with Sean Armstrong

Smule Mod Apk (VIP Unlocked) v7.8.1

Smule Mod Apk (VIP Unlocked) v7.8.1

Marlin Protocol Latest Update

A Conversation with Joshua T Berglan & Amy Sinha