How does the speed and time work in defold?

Hi, i’m making a smartphone game in defold in wich there’s different GO who spawn with a constant distance interval. My probleme is that after every spawned GO the speed of the next GO is multiplied by 1,01 and so i have to change the time interval for the next object if i want them to have a constant distance when they spawn, but i have tried different way but noone of them solved my probleme so i’m here to ask you if you have any idea how to do it ?

_ps: i’m using this dependencies for the “timer” fonction : https://github.com/britzl/defold-timer/archive/master.zip_

Here’s my code :

Note that once a repeating timer has started it will use the same interval as when it was created. In your example you’re changing temps and temps2 after the timer has started but this will not be picked up by the timer module. Using a non-repeating timer is probably better and restart it with the new time after each timer callback.

1 Like