|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectjava.awt.Component
java.awt.Container
java.awt.Panel
java.applet.Applet
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.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class java.awt.Component |
|---|
java.awt.Component.BaselineResizeBehavior |
| Field Summary |
|---|
| Fields inherited from class jgame.platform.JGEngine |
|---|
KeyBackspace, KeyTab |
| Fields inherited from class java.awt.Component |
|---|
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT |
| Fields inherited from interface jgame.impl.JGEngineInterface |
|---|
CROSSHAIR_CURSOR, DEFAULT_CURSOR, HAND_CURSOR, KeyAlt, KeyCtrl, KeyDown, KeyEnter, KeyEsc, KeyFire, KeyLeft, KeyMouse1, KeyMouse2, KeyMouse3, KeyPound, KeyRight, KeyShift, KeyStar, KeyUp, WAIT_CURSOR |
| Fields inherited from interface java.awt.image.ImageObserver |
|---|
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
| 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)
The main method. |
void |
paintFrame()
Any graphics drawing beside objects or tiles should be done here. |
void |
startApp()
(non-Javadoc) |
| 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, disableAudio, displayHeight, displayWidth, drawImage, drawImage, drawImageString, drawImageString, drawLine, drawLine, drawLine, drawOval, drawOval, drawOval, drawRect, drawRect, drawRect, drawString, drawString, drawString, drawTile, enableAudio, existsObject, exitEngine, fillBG, getAnimation, getAWTColor, 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, getTileCid, getTileCid, getTileCid, getTileCidAtCoord, getTileCoord, getTileCoord, getTileIndex, getTiles, getTiles, getTileStr, getTileStr, getTileStrAtCoord, getXAlignOfs, getXDist, getXScaleFactor, getYAlignOfs, getYDist, getYScaleFactor, inGameState, inGameStateNextFrame, init, initEngine, initEngineApplet, isApplet, isMidlet, isXAligned, isYAligned, lastPlayedAudio, markAddObject, moduloXPos, moduloYPos, moveObjects, moveObjects, orTileCid, 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, stop, stopAudio, stopAudio, tileHeight, tileWidth, viewHeight, viewTilesX, viewTilesY, viewWidth, viewXOfs, viewYOfs, wakeUpOnKey |
| Methods inherited from class java.applet.Applet |
|---|
getAccessibleContext, getAppletContext, getAppletInfo, getAudioClip, getAudioClip, getCodeBase, getDocumentBase, getImage, getImage, getLocale, getParameter, getParameterInfo, isActive, newAudioClip, play, play, resize, resize, setStub, showStatus |
| Methods inherited from class java.awt.Panel |
|---|
addNotify |
| Methods inherited from class java.awt.Container |
|---|
add, add, add, add, add, addContainerListener, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getInsets, getLayout, getListeners, getMaximumSize, getMinimumSize, getMousePosition, getPreferredSize, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paint, paintComponents, preferredSize, print, printComponents, remove, remove, removeAll, removeContainerListener, removeNotify, setComponentZOrder, setFocusCycleRoot, setFocusTraversalKeys, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setFont, setLayout, transferFocusBackward, transferFocusDownCycle, update, validate |
| Methods inherited from class java.awt.Component |
|---|
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, disable, dispatchEvent, enable, enable, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBaseline, getBaselineResizeBehavior, getBounds, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphics, getGraphicsConfiguration, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocation, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getToolkit, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, printAll, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, requestFocusInWindow, reshape, setBackground, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setMaximumSize, setMinimumSize, setName, setPreferredSize, setSize, setSize, setVisible, show, show, size, toString, transferFocus, transferFocusUpCycle |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public TorusMan()
public TorusMan(jgame.JGPoint size)
size - the size| Method Detail |
|---|
public static void main(java.lang.String[] args)
args - the argumentspublic void startApp()
startApp in class dk.itu.smds.util.JGEngineJGEngine.startApp()public 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 | ||||||||