public interface Timepiece
Timepiece is the AI clock which gives you the current time and the last delta time i.e., the time span between the
current frame and the last frame in seconds. This is the only service provider that does not depend on the environment, whether
libgdx or not. It is needed because some parts of gdx-ai (like for instance MessageDispatcher, Jump steering
behavior and Wait task) have a notion of spent time and we want to support game pause. It's developer's responsibility
to update the timepiece on each game loop. When the game is paused you simply don't update the timepiece.| Modifier and Type | Method and Description |
|---|---|
float |
getDeltaTime()
Returns the time span between the current frame and the last frame in seconds.
|
float |
getTime()
Returns the time accumulated up to the current frame in seconds.
|
void |
update(float deltaTime)
Updates this timepiece with the given delta time.
|
float getTime()
float getDeltaTime()
void update(float deltaTime)
deltaTime - the time in seconds since the last frame.Copyright © 2017. All rights reserved.