Hello everyone,
This is my first question here. I'm currently developing a top-down shooter game and I'm working on implementing an ability that grants the character a temporary movement speed boost after an enemy is killed for a few seconds. This effect should stack cumulatively, meaning each time the player kills an enemy, they receive a speed bonus that lasts for 2 seconds. However, if the player kills 10 enemies simultaneously, the speed bonus should still only last for 2 seconds (the designated duration of the skill), but the speed bonus should be 10 stronger.
I've been able to implement the basic functionality successfully. The challenge I'm facing now is how to pause and resume this speed bonus effect. Currently, I'm using a system - wait action that adds the speed bonus, waits for two seconds, and then removes it. However, this approach doesn't allow me to pause or resume the speed bonus once it's activated.
I've attempted to use a timer behavior instead, but I couldn't achieve the desired results because I need the speed bonuses to accumulate correctly.
I would greatly appreciate any help or advice you can provide. If needed, I can provide more details about the implementation.