Determining the duration of powerup effects on Player

Any game is incomplete without additional power that gets bestowed upon a gamer by collecting abstract artifacts.

They can be symbolic game objects that push extra strength for a certain amount of time while one plays against enemies.

It is worth noting that their interaction solely happens with the player.

In the scenario of giving a life limit to such a booster, a developer must adhere to the gamers’ tendencies toward excitement and timing. The boost shall sustain for a very limited window so that the gamer gets on tows for optimum use and at the same time, it must arrive at a juncture when the gamer is about to see a defeat.

In the case of the game below, there are three distinct powers to be collected. A triple bullet shot, a speed multiplier, and a shield that saves a life.

Based on my understanding so far, a duration for all of them turned out to be oscillating roughly in between 3 to 7 seconds considering that the enemy spawning is occurring at 5-second intervals.

A simple implementation using a coroutine is as followed.

C#

Thank you very much

--

--

--

Work in Progress.

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

Recommended from Medium

AWS Cloud Revolutionizing Business

Oh Where, Oh Where Has My Data Gone? Oh Where, Oh Where Could it Be?

Research/Spike/Build-Encouraging Innovation While Minimizing System Risk

How to write a Mastermind in C?

Onboarding developers to Golem via Gitcoin

PancakeSwap’s Mobox Trading Battle with Prizes Worth Up to $80,000 with Tokens and NFTs!

5 Podcasts that Increase your Software skills

CRUD Operations with the Realm in Swift

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
Samarth Dhroov

Samarth Dhroov

Work in Progress.

More from Medium

Retrospective of the 2D Galaxy Shooter

Creating a material in Unity

Return of the Amazon Queen

The right way to wrap your UI inside the safe area — Unity