Event handling in the Game loop
-
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.
-
I never use 0. More like 0.1, rarely does it have to be that sudden...
-
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.
-
@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.
-
@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.
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login