Determining How Long Powerup Effects Should Last..

Anurag Chawla
2 min readApr 15, 2021

PowerUp Effects — Plays important role..and how long player should have that depends on the use case based on the Game Scenario.

Consider for our Galaxy Shooter 2D- for Triple-Shot Power-up, when player collect this power-up..he started shooting..three shots of lasers and this triple — shots of laser lasts for couple of seconds say 5 sec before it turns into original.

Design & logical mechanics for this PowerUp effects as under..

Here we have Power-Up Prefabs and for these prefabs we have Power-Up Scripts attached with respective _powerupID ref variable. Now when Player collect Triple-Shot , it happens during OnTriggerEnter2D event in PowerUp Script — It calls the player.TripleShotActive() method.

PowerUp-Script

Now in Player Script.. when TripleShotActive() method is called, it set boolean variable set to true and calls the coroutine -TripleShotPowerDownRoutine()

Snippet of Script- TripleShotActive() method

So, when it sets _isTripleShotActive to true , it starts instantiating TripleShotLaser prefab i.e, three lasers in one shot unless it again sets to false after 5 sec..then start instantiating one laser.. .

This is how long PowerUp Effects last…based on the choice of Game Scenario ..

@GameDevHQ-Day 17…

--

--

Anurag Chawla

Emerging Technologies - Power Virtual Agents | AI Chatbots | Multi-Cloud & DevOps | UI Technologies - React , Angular | Gaming Technolgies - Unity, XR- AR/VR