|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectvooga.gameEngine.game.GameRelatedObject
vooga.gameEngine.controller.GameRelatedController
vooga.gameEngine.controller.TimingController
public class TimingController
Class TimingController
keeps track of the current time elapsed
in a game or level.
Constructor Summary | |
---|---|
TimingController()
|
Method Summary | |
---|---|
void |
addTime(long dt)
Adds the change in time, dt to the time. |
long |
getGameTime()
Gives the current game time. |
long |
getTimeSinceLastFrame()
Gives the time between frames. |
long |
getTotalGameTime()
Gives the total game time since the game was started. |
long |
getTotalLevelTime()
Gives the time since level start. |
void |
pauseTime()
Marks the time in which a pause occurred. |
void |
resumeTime()
Determines the length of the pause, and adds that amount to the total paused time for the overall game and the specific level. |
void |
startLevel()
Starts a new level timer by setting the level start time to the current time. |
void |
startTime()
Starts the timing with a start time of 0. |
void |
startTime(long startTime)
Starts the timing with a given startTime. |
void |
TimeController()
Creates a new time object with all values set to 0. |
void |
updateTime()
Updates the time to the current time by adding the time elapsed since the last update was called. |
void |
updateTime(long time)
Updates the time to the given time. |
Methods inherited from class vooga.gameEngine.game.GameRelatedObject |
---|
addEventListener, clearListeners, equals, fire, fire, fire, getEventListeners, getID, getListenerCount, removeEventListener |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public TimingController()
Method Detail |
---|
public void TimeController()
public void startTime()
public void startTime(long startTime)
startTime
- in millisecondspublic void updateTime()
public void updateTime(long time)
time
- to be changed topublic void addTime(long dt)
dt
- milliseconds to addpublic void startLevel()
public long getTimeSinceLastFrame()
updateTime()
was calledpublic long getTotalLevelTime()
startLevel()
was calledpublic long getGameTime()
public long getTotalGameTime()
public void pauseTime()
public void resumeTime()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |