public interface IGameLoop extends ILoop
IGameLoop
interface provides special methods for the game's main loopModifier and Type | Method and Description |
---|---|
void |
alterExecutionTime(int id,
long tick)
Alters the execution time of the timed action with the specified index to the defined tick.
|
float |
getTimeScale()
Gets the game loop's current time scale (default = 1).
|
int |
perform(int delay,
java.lang.Runnable action)
Performs a timed action with the specified delay in ms.
|
void |
removeAction(int id)
Removes the
TimedAction with the specified it. |
void |
setTimeScale(float timeScale)
Sets the game loop's time scale.
|
attach, detach, getDeltaTime, getLock, getProcessTime, getTickRate, getTicks, getUpdatableCount, setTickRate
start, terminate
int perform(int delay, java.lang.Runnable action)
delay
- The delay in milliseconds.action
- The action to perform, once the delay has passed.TimedAction
that can be used to alter the execution time of the action or remove it.alterExecutionTime(int, long)
void alterExecutionTime(int id, long tick)
id
- The id of the TimedAction
.tick
- The tick at which to perform the action instead.void removeAction(int id)
TimedAction
with the specified it.id
- The id of the TimedAction
.float getTimeScale()
void setTimeScale(float timeScale)
This can be used to fast-forward the gameplay or to introduce slow-motion effects.
timeScale
- The time scale to set.