Event handling in the Game loop
TutorialDoctor last edited by
We find ourselves using a timer set to 0 seconds to process behaviors on any given frame of the game loop.
Any plans to allow us to make updates in the game loop without timers and the limits that comes with?
Timers of 0 is the game loop. Basically we just say don't do too much in your game loop because it will start lagging.
GameCRAZY last edited by
I never use 0. More like 0.1, rarely does it have to be that sudden...
Aidan Oxley last edited by
Depends on what you're doing, sometimes 0.1 is ok but sometimes it looks too rough for what you're trying to do. 3D was too laggy with 0s so I made it 0.1 with the moves taking 0.1 seconds to finish.
Jack8680 last edited by
@Aidan-Oxley yeah, if you want a transition or to draw something, you probably want it at timer 0 since that's 60 per second, same as the fps. You can also do timer(0.033) if you want it to be every second frame. Also, @Hamed, does the input for timer and wait get rounded to the nearest 60th, or does it run in between game ticks if we don't have a rational number?
It gets rounded.
TutorialDoctor last edited by TutorialDoctor
@Hamed Cool, so this is perfectly fine in Birds Eye View mode to simulate gravity or to even expand it to create your own physics setup at no additional cost nor advantage? I wonder what would happen if this were applied to a tag of physics objects.