Better cooldown in Action RPG Framework
|
|
Resolved
|
It's not exactly like this code you linked to, but now it will be based off of world.time so there aren't any spawns or sleeps associated with using cooldowns.
|
|
|
| Status: |
Resolved (4)
This issue has been resolved.
|
|
|
This should give you the idea of what I'm thinking of.
The current cooldown system uses spawn() to clear a cooldown state. What Jtgibson's ActionLock system does is set the value of cooldowns to (world.time + duration). Whenever you check if the cooldown is finished, you compare it with the current world.time, so you don't need to spawn() anything off.
I think you could also allow for setting a cooldown's duration to -1 to make it permanent instead of relying on time.
|
I'll probably make this change in the next update since I'm using cooldowns for more things, like limiting how often enemies check for a target.