Determining How Long PowerUp Effects Should Last

Ryan McCoach
2 min readApr 6, 2021

--

The first powerup I placed in the game is the Triple Shot. When the player collects the Triple Shot powerup, they are able to shoot 3 lasers at a time compared to the normal 1 laser. When implementing powerups, you want to think about their functionally and how it will impact gameplay. In regards to the Triple Shot, it is an upgrade of the primary weapon, so the player needs the basic skill of getting the player in position to hit the enemy, but they do not need as much accuracy. This powerup should have a limited lifespan and this can be approach in dfferent ways. For now, the approach I took was making it a timed powerup. This approach allows the player to use the Triple Shot as much as they want in a limited window of time, but when the time is up the powerup is turned off.

To make this work, I will need to add a boolean variable that will control if the isTripleShotActive or not. When the game starts, this boolean is set to false until the player collects the Triple Shot powerup, which calls the TripleShotActive method. When TripleShotActive is called, it sets the boolean true.

This allows me to make the conditional to check if the isTripleShotActive is true or false. When it is true , the _tripleShotPrefab is Instantiate and when it is false, the _laserPrefab is Instantiate. Now, we need to create an IEnumerator for the ability to yield some time.

Currently, the script is set to wait for 5 seconds before setting _isTripleShotActive back to false, which will set off the ELSE statement in the CONDITIONAL where the singe _laserPrefab is being Instantiate instead of the _tripleShotPrefab. The 5 seconds of the Triple Shot PowerUp seems right, but as the game continues to evolve, it will need to continually be play tested to make sure the lifespan of the powerup is still a good fit.

--

--

No responses yet