Add a "start timer" parameter to timer conditions? #3446
D8H
started this conversation in
Enhancement ideas (and their technical discussions)
Replies: 1 comment 5 replies
-
Yep this design was probably not a good idea. There have been some discussions about adding a toggle parameter to choose if the timer should be started (#3065, #3282) and I think it's a good idea to add this. |
Beta Was this translation helpful? Give feedback.
5 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
According to GDJS\Runtime\events-tools\runtimescenetools.ts, a timer is started when a condition checks its value.
I understand that it makes it easier to make an action repeat every N seconds. But it also makes it harder to use timers to check if something happens in less than N seconds, because it requires to pause the timers at the beginning of the scene and when the condition is "consumed". Without a pause, the condition will always be true for the N 1st seconds of the scene.
I don't really like the idea that conditions can have side effects, but I think that they should at least be explicit.
Should a boolean parameter be added to timer condition to let the user choose to start the timer or not?
Example
In this dumb example, the player tries to press Space when ball bounce on the screen border within a -0.3 to 0.3 second time frame.
Beta Was this translation helpful? Give feedback.
All reactions