Package de.gurkenlabs.litiengine
Interface IGameLoop
- All Superinterfaces:
ILaunchable,ILoop
- All Known Implementing Classes:
GameLoop
The
IGameLoop interface provides special methods for the game's main loop-
Method Summary
Modifier and TypeMethodDescriptionvoidalterExecutionTime(int id, long tick) Alters the execution time of the timed action with the specified index to the defined tick.floatGets the game loop's current time scale (default = 1).intPerforms a timed action with the specified delay in ms.voidremoveAction(int id) Removes theTimedActionwith the specified it.voidsetTimeScale(float timeScale) Sets the game loop's time scale.Methods inherited from interface de.gurkenlabs.litiengine.ILaunchable
start, terminateMethods inherited from interface de.gurkenlabs.litiengine.ILoop
attach, detach, getDeltaTime, getLock, getProcessTime, getTickRate, getTicks, getUpdatableCount, setTickRate
-
Method Details
-
perform
Performs a timed action with the specified delay in ms.- Parameters:
delay- The delay in milliseconds.action- The action to perform, once the delay has passed.- Returns:
- The id of the
TimedActionthat can be used to alter the execution time of the action or remove it. - See Also:
-
alterExecutionTime
void alterExecutionTime(int id, long tick) Alters the execution time of the timed action with the specified index to the defined tick. This overwrites the originally specified delay.- Parameters:
id- The id of theTimedAction.tick- The tick at which to perform the action instead.
-
removeAction
void removeAction(int id) Removes theTimedActionwith the specified it.- Parameters:
id- The id of theTimedAction.
-
getTimeScale
float getTimeScale()Gets the game loop's current time scale (default = 1).- Returns:
- The game loop's current time scale.
-
setTimeScale
void setTimeScale(float timeScale) Sets the game loop's time scale.This can be used to fast-forward the gameplay or to introduce slow-motion effects.
- Parameters:
timeScale- The time scale to set.
-