|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.deken.game.GameTimer
public abstract class GameTimer
Title: GameTimer
Description: Abstract GameTimer. The abstract methods are implemented inside the GameCanvas.
Copyright: Copyright (c) Dec 12, 2010
Field Summary | |
---|---|
protected boolean |
listeners
|
static int |
MAX_FRAME_SKIPS
|
static int |
NO_DELAYS_PER_YIELD
|
static long |
period
100 Frames per second (FPS) 1000sec/100frames = 10 ms. |
protected boolean |
running
|
protected java.util.List<TimeListener> |
timeListeners
|
protected long |
totalTime
|
Constructor Summary | |
---|---|
GameTimer()
|
Method Summary | |
---|---|
void |
addTimeListeners(TimeListener timeListener)
Adds a TimeListener to this GameTimer for receiving the number of seconds. |
boolean |
isRunning()
Returns if this GameTimer is running or not. |
abstract void |
paint()
|
abstract void |
render()
|
void |
resetGameTime()
|
void |
run()
|
void |
setRefreshRate(int refreshRate)
Make the Frames per second equivalent to the refresh rate. |
void |
setRunning(boolean running)
Set if the game is running or not. |
protected long |
tick()
|
abstract void |
update(long deltaTime)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static long period
public static final int NO_DELAYS_PER_YIELD
public static final int MAX_FRAME_SKIPS
protected java.util.List<TimeListener> timeListeners
protected boolean listeners
protected volatile boolean running
protected long totalTime
Constructor Detail |
---|
public GameTimer()
Method Detail |
---|
public abstract void update(long deltaTime)
public abstract void render()
public abstract void paint()
public void run()
public void addTimeListeners(TimeListener timeListener)
timeListener
- public void setRefreshRate(int refreshRate)
refreshRate
- public void setRunning(boolean running)
running
- public void resetGameTime()
public boolean isRunning()
protected long tick()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |