Solve Fly faster counter to use multiple Fly Faster power Ups inside the level


We encountered a bug last week related to the 'fly faster' power-up. If a player used more than one 'fly faster' power-up, the first one would function correctly, but the second one would not. This issue stemmed from the implementation of the power-up, which solely relied on a delay.

The problem arose because the implementation utilized a timer that would start when the player activated the 'fly faster' power-up. Once this timer counted down to zero, the 'fly faster' effect would deactivate. To address this, I devised a new solution in C++ that involved the introduction of a cooldown variable.

In this new implementation, every time a player picked up the 'fly faster' power-up, the cooldown timer would increase. Consequently, the 'fly faster' power-up would remain active for an extended period. Once the cooldown variable reaches zero, the 'fly faster' effect will be disabled.

I am including a video to be clearer about this bug and how I was able to solve it.
Youtube Link:

Leave a comment

Log in with itch.io to leave a comment.