Initially, I assumed that the developer has to implement the game loop because libgdx is a library - not an engine. But then I found out that Graphics has getDeltaTime()
and getRawDeltaTime()
so I assume that the game loop is already implemented.
If it is implemented, could someone explain what method libgdx uses? I'm mainly referring to this article. My guess is that it uses a semi-fixed time step? If that's the case, then why might getDeltaTime()
"be smoothed over n frames?" How exactly is getDeltaTime()
smoothed?
If the game loop is not implemented, what is the purpose of getDeltaTime()
when you have getRawDeltaTime()
?
render(delta time)
method of your scene. When it passes your threshold, you can advance your game model and reset the time variable to 0. \$\endgroup\$render()
function you override in your class which extends theApplicationAdapter
class.getDeltaTime()
is used for moving objects according to time elapsed instead of the frame rate which is not guaranteed to be consistent across all devices \$\endgroup\$getDeltaTime()
is smoothed? \$\endgroup\$getDeltaTime()
, I've found this thread.getDeltaTime()
seems to actually be an average of delta time values so I'm going to avoid it because it will cause the game to run at a variable/non-constant speed. Instead, I will usegetRawDeltaTime()
. \$\endgroup\$