hpi-swa-lab / godot-pronto

https://hpi-swa-lab.github.io/godot-pronto/
18 stars 4 forks source link

Cooldown Behavior #198

Open jgrenda opened 9 months ago

jgrenda commented 9 months ago

During the creation of prototypes, it might be necessary to allow a certain action to be performed only every X seconds. In the same vein, it might be required to prevent performing a certain action for X seconds after its execution. Examples might be the shooting of a gun which happens on mouse-click but should not happen more often than once every 0.5 seconds, or a power-up that lasts 10 seconds with a certain effect.

The cooldown effect currently can be realized using multiple connections:

image

This is cumbersome and requires a specific order of operation to prevent deadlocks or ineffective cooldowns. As such constructs are required more often than previously anticipated a dedicated behavior for this might be useful.