|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectandroid.gameengine.icadroids.engine.GameLoop
public class GameLoop
GameLoop is the Thread that handles the timing of the GameLogic and the
drawing.
Generally, game programmers will not make direct use of this class. It
handles the internal workings of the GameEngine.
Field Summary | |
---|---|
Canvas |
c
Canvas that needs to be drawn |
static int |
MAX_FPS
Max FPS of this Game |
Constructor Summary | |
---|---|
protected |
GameLoop(GameEngine ge)
Intialize the Gameloop |
Method Summary | |
---|---|
void |
endDraw(Canvas c)
Stop Drawing |
long |
getCurrentSystemTime()
Get the current system time in milliseconds |
boolean |
getRunningState()
Get the running staat of the GameLoop Thread |
void |
run()
Main game-loop thread that handles gamelogic and rendering. |
void |
setRunning(boolean running)
Start or stop the gameloop from running |
void |
setView(GameView view)
Set the view which the GameLoop draws on |
void |
startDraw()
Start drawing on the canvas |
protected void |
updateGame()
Allows the game to run logic such as updating the world, checking for collisions, gathering input, and playing audio. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static int MAX_FPS
public Canvas c
Constructor Detail |
---|
protected GameLoop(GameEngine ge)
ge
- GameEngine which the game is currently running onMethod Detail |
---|
public final void setRunning(boolean running)
running
- true to start, false to stoppublic final long getCurrentSystemTime()
public void run()
run
in interface java.lang.Runnable
public final void startDraw()
public final void endDraw(Canvas c)
c
- Canvas that needs to be stop drawingprotected void updateGame()
public final void setView(GameView view)
view
- public final boolean getRunningState()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |