org.jtgl.micro
Class GameMapplet

java.lang.Object
  extended by org.jtgl.micro.Mapplet
      extended by org.jtgl.micro.GameMapplet
All Implemented Interfaces:
java.lang.Runnable

public abstract class GameMapplet
extends Mapplet
implements java.lang.Runnable

GameMapplet is a base class for a gaming Mapplet.

Author:
Manuel Polo (manuel_polo at yahoo dot es)

Field Summary
static int MAX_FPS
           
static int MIN_FPS
           
static int REFRESH_AUTO
           
static int REFRESH_MANUAL
           
 
Constructor Summary
GameMapplet()
           
 
Method Summary
protected abstract  void drawGameScene()
           
 void enableFPSMeasure(boolean enable)
           
 int getFps()
           
 long getFrameCounter()
           
 long getFrameTime()
           
 int getKeys()
           
 long getMaxFrameTime()
           
 long getMinFrameTime()
           
 int getRandom(int to)
           
 int getRandom(int from, int to)
           
 long getRealFPS()
           
 long getRealMFPS()
           
 int getRefreshType()
           
protected  void initGame()
           
 boolean isRunning()
           
 void kill(boolean force)
          Kill Mapplet
 void pause()
          Pause Mapplet
protected abstract  void processGameLogic()
           
 void refreshGraphics()
           
 void reset()
          Dirty method for complete reinitialization of game
 void run()
           
 void setFps(int fps)
           
 void setRefreshType(int type)
           
 void start()
          Start Mapplet
 
Methods inherited from class org.jtgl.micro.Mapplet
createImage, createImage, createImage, debugMsg, delay, flushGraphics, get, getAvailableInputControls, getDisplayColors, getGraphics, getHeight, getImageUtil, getInputControl, getWidth, handleException, handleException, initialize, initialize, notifyKill, setDebug
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

REFRESH_MANUAL

public static final int REFRESH_MANUAL
See Also:
Constant Field Values

REFRESH_AUTO

public static final int REFRESH_AUTO
See Also:
Constant Field Values

MIN_FPS

public static final int MIN_FPS
See Also:
Constant Field Values

MAX_FPS

public static final int MAX_FPS
See Also:
Constant Field Values
Constructor Detail

GameMapplet

public GameMapplet()
Method Detail

start

public void start()
Description copied from class: Mapplet
Start Mapplet

Overrides:
start in class Mapplet

pause

public void pause()
Description copied from class: Mapplet
Pause Mapplet

Overrides:
pause in class Mapplet

reset

public void reset()
Dirty method for complete reinitialization of game


kill

public void kill(boolean force)
          throws JTGLException
Kill Mapplet

Overrides:
kill in class Mapplet
Throws:
JTGLException

setRefreshType

public void setRefreshType(int type)

getRefreshType

public int getRefreshType()

refreshGraphics

public void refreshGraphics()

setFps

public final void setFps(int fps)

getFps

public final int getFps()

enableFPSMeasure

public void enableFPSMeasure(boolean enable)

getFrameCounter

public final long getFrameCounter()

getRealFPS

public final long getRealFPS()

getRealMFPS

public final long getRealMFPS()

getFrameTime

public final long getFrameTime()

getMaxFrameTime

public final long getMaxFrameTime()

getMinFrameTime

public final long getMinFrameTime()

getKeys

public int getKeys()

getRandom

public int getRandom(int to)

getRandom

public int getRandom(int from,
                     int to)

isRunning

public boolean isRunning()

run

public void run()
Specified by:
run in interface java.lang.Runnable

initGame

protected void initGame()
                 throws java.lang.Exception
Throws:
java.lang.Exception

processGameLogic

protected abstract void processGameLogic()

drawGameScene

protected abstract void drawGameScene()