|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectjavax.microedition.midlet.MIDlet
jgame.platform.JGEngine
dk.itu.smds.util.JGEngine
dk.itu.smds.torusman.TorusMan
public class TorusMan
Tutorial example 1: a minimal program. A "bare skeleton" program displaying a moving text "hello world". In order to run as both applet and application, you need to define a main() method (this is the entry point for an application) and a parameterless constructor (this is the entry point for an applet). We use a second constructor with a size parameter to initialise the engine as an application.
| Field Summary |
|---|
| Fields inherited from interface jgame.impl.JGEngineInterface |
|---|
CROSSHAIR_CURSOR, DEFAULT_CURSOR, HAND_CURSOR, KeyAlt, KeyBackspace, KeyCtrl, KeyDown, KeyEnter, KeyEsc, KeyFire, KeyLeft, KeyMouse1, KeyMouse2, KeyMouse3, KeyPound, KeyRight, KeyShift, KeyStar, KeyTab, KeyUp, WAIT_CURSOR |
| Constructor Summary | |
|---|---|
TorusMan()
The parameterless constructor is called by the browser, in case we're an applet. |
|
TorusMan(jgame.JGPoint size)
We use a separate constructor for starting as an application. |
|
| Method Summary | |
|---|---|
void |
doFrame()
Game logic is done here. |
void |
initCanvas()
This method is called by the engine when it is ready to intialise the canvas (for an applet, this is after the browser has called init()). |
void |
initGame()
This method is called when the engine has finished initialising and is ready to produce frames. |
static void |
main(java.lang.String[] args)
|
void |
paintFrame()
Any graphics drawing beside objects or tiles should be done here. |
void |
startApp()
|
| Methods inherited from class jgame.platform.JGEngine |
|---|
addGameState, and, andTileCid, atan2, checkBGCollision, checkBGCollision, checkCollision, checkCollision, clearGameState, clearKey, clearLastKey, clearMouseButton, countObjects, countObjects, countTiles, dbgExceptionToString, dbgPrint, dbgPrint, dbgSetDebugColor1, dbgSetDebugColor2, dbgSetMessageExpiry, dbgSetMessageFont, dbgShowBoundingBox, dbgShowException, dbgShowFullStackTrace, dbgShowGameState, dbgShowMessagesInPf, defineAnimation, defineAnimation, defineAudioClip, defineImage, defineImage, defineImage, defineImage, defineImageMap, defineMedia, destroy, destroyApp, disableAudio, displayHeight, displayWidth, doFrameEnterHighscore, doFrameGameOver, doFrameHighscores, doFrameInGame, doFrameLevelDone, doFrameLifeLost, doFramePaused, doFrameStartGame, doFrameStartLevel, doFrameTitle, drawImage, drawImage, drawImageString, drawImageString, drawLine, drawLine, drawLine, drawOval, drawOval, drawOval, drawRect, drawRect, drawRect, drawString, drawString, drawString, drawTile, enableAudio, existsObject, exitEngine, fillBG, getAnimation, getBufferGraphics, getConfigPath, getFontHeight, getFrameRate, getFrameSkip, getGameSpeed, getImage, getImageBBox, getImageSize, getKey, getKeyCode, getKeyCodeStatic, getKeyDesc, getKeyDescStatic, getLastKey, getLastKeyChar, getMinScaleFactor, getMouseButton, getMouseInside, getMousePos, getMouseX, getMouseY, getObject, getObjects, getOffscreenMarginX, getOffscreenMarginY, getParameter, getTileCid, getTileCid, getTileCid, getTileCidAtCoord, getTileCoord, getTileCoord, getTileIndex, getTiles, getTiles, getTileStr, getTileStr, getTileStrAtCoord, getXAlignOfs, getXDist, getXScaleFactor, getYAlignOfs, getYDist, getYScaleFactor, inGameState, inGameStateNextFrame, initEngine, initEngineApplet, isApplet, isMidlet, isXAligned, isYAligned, lastPlayedAudio, markAddObject, moduloXPos, moduloYPos, moveObjects, moveObjects, orTileCid, paintFrameEnterHighscore, paintFrameGameOver, paintFrameHighscores, paintFrameInGame, paintFrameLevelDone, paintFrameLifeLost, paintFramePaused, paintFrameStartGame, paintFrameStartLevel, paintFrameTitle, pauseApp, pfHeight, pfTilesX, pfTilesY, pfWidth, pfWrapX, pfWrapY, playAudio, playAudio, random, random, random, registerTimer, removeAllTimers, removeGameState, removeObject, removeObjects, removeObjects, requestGameFocus, setAuthorMessage, setBGColor, setBGImage, setCanvasSettings, setColor, setColorsFont, setFGColor, setFont, setFont, setFrameRate, setGameSpeed, setGameState, setKey, setMouseButton, setMouseCursor, setMouseCursor, setMsgFont, setOffscreenMargin, setPFSize, setPFWrap, setProgressBar, setProgressMessage, setRenderSettings, setScalingPreferences, setStroke, setTextOutline, setTile, setTile, setTileCid, setTileCid, setTiles, setTileSettings, setTilesMulti, setViewOffset, snapToGrid, snapToGridX, snapToGridY, start, startEnterHighscore, startGameOver, startHighscores, startInGame, startLevelDone, startLifeLost, startPaused, startStartGame, startStartLevel, startTitle, stop, stopAudio, stopAudio, tileHeight, tileWidth, tryMethod, viewHeight, viewTilesX, viewTilesY, viewWidth, viewXOfs, viewYOfs, wakeUpOnKey |
| Methods inherited from class javax.microedition.midlet.MIDlet |
|---|
checkPermission, getAppProperty, notifyDestroyed, notifyPaused, platformRequest, resumeRequest |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public TorusMan()
public TorusMan(jgame.JGPoint size)
| Method Detail |
|---|
public static void main(java.lang.String[] args)
public void startApp()
startApp in class dk.itu.smds.util.JGEnginepublic void initCanvas()
initCanvas in interface jgame.impl.JGEngineInterfaceinitCanvas in class jgame.platform.JGEnginepublic void initGame()
initGame in interface jgame.impl.JGEngineInterfaceinitGame in class jgame.platform.JGEnginepublic void doFrame()
doFrame in interface jgame.impl.JGEngineInterfacedoFrame in class jgame.platform.JGEnginepublic void paintFrame()
paintFrame in interface jgame.impl.JGEngineInterfacepaintFrame in class jgame.platform.JGEngine
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||