jgame
Class StdGame

java.lang.Object
  extended byjava.awt.Component
      extended byjava.awt.Container
          extended byjava.awt.Panel
              extended byjava.applet.Applet
                  extended byjgame.JGEngine
                      extended byjgame.StdGame
All Implemented Interfaces:
javax.accessibility.Accessible, java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable

public abstract class StdGame
extends JGEngine

A basic framework for a game. It supports an animation and game timer, object creation at fixed intervals, score, lives, levels, configurable keys. There are title, start-level, next-level, death, and game-over sequences. Todo: highscores, key configuration file and GUI.

To initialise this class, use the regular initEngine (from main), or initEngineApplet (from parameterless constructor). You can supply the width and height of the window as command line arguments by calling parseSizeArgs(args) from your main(). Define initGame() as usual. StdGame does all its logic in the doFrame method, so you should ensure that it is called (i.e. call super.doFrame() if you choose to override doFrame). The game will automatically start in the "Title" gamestate when it finds that it isn't in this state in the first call to doFrame(). You can also set the "Title" state in initGame if you even want the first frame to be in "Title".

The class uses the following state machine, using JGEngine's state machine mechanism:

Title: displays title screen. Transition to {StartLevel,StartGame} when the key_startgame is pressed. Before the transition, initNewGame(), defineLevel(), and initNewLife() are called.

InGame: game is playing. Transition to LifeLost when lifeLost() is called from within the game. Transition to LevelDone when levelDone() is called from within the game. Transition to GameOver when gameOver() is called (i.e. to quit game). The gametime timer indicates how many ticks the game has been running since the beginning of the level.

StdGame supports a set of standard game sequences, which are represented as game states: StartLevel/StartGame, LevelDone, LifeLost, GameOver. These can be configured so they add the InGame state to the sequence state (i.e. the game is in both states simultaneously). This can be used to animate the game while playing the corresponding sequence. This is off by default. The seqtimer timer is set to 0 at the beginning of each sequence, and increments during the sequence to indicate how many ticks the sequence has been playing. The number of ticks that the sequence should take can be configured, or the sequence can be skipped altogether by setting ticks to 0.

StartGame: start game sequence is played. Transition to InGame after a certain time has elapsed or the contgame key is pressed.

StartLevel: start level sequence is played. Transition to InGame after a certain time has elapsed or the contgame key is pressed. Is always active in combination with StartGame; it's just an indication that StartGame is also a start of a new level.

LevelDone: next level sequence is played. Transition to StartLevel/StartGame after a certain time has elapsed or the contgame key is pressed. Before the transition, resp. incrementLevel() and defineLevel() are called.

LifeLost: player has just died, a death sequence is played. Transition to either GameOver or StartGame after a certain time has elapsed or the contgame key is pressed, dependent of whether there are lives left. Before the transition to StartGame, decrementLives() and initNewLife are called.

GameOver: game over sequence is played. Transition to Title after a certain time or the contgame key is pressed.

Built in are also game exit (through the key_quitgame, which is Escape by default), and pause game (through the key_pausegame, which defaults to 'P').

See Also:
Serialized Form

Nested Class Summary
 
Nested classes inherited from class java.applet.Applet
java.applet.Applet.AccessibleApplet
 
Nested classes inherited from class java.awt.Panel
java.awt.Panel.AccessibleAWTPanel
 
Nested classes inherited from class java.awt.Container
java.awt.Container.AccessibleAWTContainer
 
Nested classes inherited from class java.awt.Component
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy
 
Field Summary
 boolean gameover_ingame
          Indicates whether the InGame state should be retained when in the corresponding sequence state.
 int gameover_ticks
          Number of ticks to stay in GameOver state, 0 = skip
 int gametime
          Game timer.
 int initial_lives
          Initial value for lives; default=4
 int[] key_action
          Keys for special actions.
 int key_contgame
          Key for continuing the game when in a sequence, default = space.
 int key_down
          Key for moving, default = cursors.
 int key_downleft
          Key for moving diagonally, default = none.
 int key_downright
          Key for moving diagonally, default = none.
 int key_fire
          Key for firing (in case there are no separate directional fire keys), default=Z.
 int key_firedown
          Key for directional firing, default = WSAD keys
 int key_firedownleft
          Key for diagonal firing, default = none
 int key_firedownright
          Key for diagonal firing, default = none
 int key_fireleft
          Key for directional firing, default = WSAD keys
 int key_fireright
          Key for directional firing, default = WSAD keys
 int key_fireup
          Key for directional firing, default = WSAD keys
 int key_fireupleft
          Key for diagonal firing, default = none
 int key_fireupright
          Key for diagonal firing, default = none
 int key_left
          Key for moving, default = cursors.
 int key_pausegame
          Key for pausing the game, default = P.
 int key_quitgame
          Key for quitting the game, default = escape.
 int key_right
          Key for moving, default = cursors.
 int key_startgame
          Key for starting the game, default = space.
 int key_up
          Key for moving, default = cursors.
 int key_upleft
          Key for moving diagonally, default = none.
 int key_upright
          Key for moving diagonally, default = none.
 int level
          Difficulty level; starts at 0 at beginning of game.
 boolean leveldone_ingame
          Indicates whether the InGame state should be retained when in the corresponding sequence state.
 int leveldone_ticks
          Number of ticks to stay in LevelDone state, 0 = skip
 boolean lifelost_ingame
          Indicates whether the InGame state should be retained when in the corresponding sequence state.
 int lifelost_ticks
          Number of ticks to stay in LifeLost state, 0 = skip
 int lives
          Lives count, 0 means game over.
 java.lang.String lives_img
          Image to use to display lives
 int score
          Player score; starts at 0 at beginning of game.
 int seqtimer
          Sequence timer.
 int stage
          Game stage, which is usually the same as level, but typically goes on counting, while level may stop increasing at a certain value.
 boolean startgame_ingame
          Indicates whether the InGame state should be retained when in the corresponding sequence state.
 int startgame_ticks
          Number of ticks to stay in StartLevel/StartGame state, 0 = skip
 java.awt.Color status_color
          Color to use to display score
 java.awt.Font status_font
          Font to use to display score
 int timer
          Animation timer.
 java.awt.Color title_bg_color
          Color to use to display background effects behind title and messages
 java.awt.Color title_color
          Color to use to display title and messages
 java.awt.Font title_font
          Font to use to display title and messages
 
Fields inherited from class jgame.JGEngine
KeyAlt, KeyCtrl, KeyDown, KeyLeft, KeyMouse1, KeyMouse2, KeyMouse3, KeyRight, KeyShift, KeyUp
 
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
StdGame()
           
 
Method Summary
 boolean checkTime(int increment)
          Returns true every increment ticks.
 boolean checkTime(int min_time, int max_time, int increment)
          Returns true every increment ticks, but only when gametime is between min_time and max_time.
 java.awt.Color cycleColor(java.awt.Color[] cycle, int tmr, double speed)
          Get a colour from a colour cycle.
 void decrementLives()
          Code for losing a life before transition from LifeLost to InGame is made.
 void defineLevel()
          Initialise a level.
 void doFrame()
          The main doFrame takes care of all the standard game actions.
 void drawCount(int count, java.lang.String image, int x, int y, int increment_x)
          Draw a row of objects to indicate the value count.
 void drawWavyString(java.lang.String s, int x, int y, int align, int increment_x, int tmr, double amplitude, double pos_phaseshift, double timer_phaseshift, java.awt.Font font, java.awt.Color col)
          Draw a string with letters that move up and down individually.
 void gameOver()
          Call to make straight transition to GameOver; is called automatically by lifeLost when appropriate.
 java.awt.Font getZoomingFont(java.awt.Font basefont, int tmr, double min_size_fac, double speed)
          Get font for zooming text in and out.
 void incrementLevel()
          Code for incrementing a level before transition from LevelDone to InGame is made.
 void initNewGame()
          Initialise the game when a new game is started.
 void initNewLife()
          Initialise play specifically after a new life is introduced (that is, at game start and after the player has died.
 void levelDone()
          Call to make state transition to LevelDone.
 void lifeLost()
          Call to make state transition to LifeLost.
 void paintFrame()
          Default paintFrame displays score at top left, lives at top right.
 void paintFrameGameOver()
          Default displays "Game Over!".
 void paintFrameLevelDone()
          Default displays "Level Done !".
 void paintFrameLifeLost()
          Default displays "Life Lost !".
 void paintFramePaused()
          The game is halted in pause mode, but the paintFrame is still done to refresh the screen.
 void paintFrameStartGame()
          Default displays "Start !".
 void paintFrameStartLevel()
          Default displays "Level "+(stage+1).
 void paintFrameTitle()
          Default displays class name as title, and "press [key_startgame] to start" below it.
static java.awt.Dimension parseSizeArgs(java.lang.String[] args)
          Parse the first two arguments assuming they are width and height.
 int posWalkForwards(int begin_pos, int end_pos, int tmr, int end_time, int standstill_pos, int standstill_time, int standstill_count)
          Walk across the screen, standing still momentarily at a specific position.
 void setSequences(boolean startgame_ingame, int startgame_ticks, boolean leveldone_ingame, int leveldone_ticks, boolean lifelost_ingame, int lifelost_ticks, boolean gameover_ingame, int gameover_ticks)
          Set all sequence variables in one go.
 void setStatusDisplay(java.awt.Font status_font, java.awt.Color status_color, java.lang.String lives_img)
          Set the status display variables in one go.
 void startGameOver()
          Initialise game over sequence.
 void startInGame()
          Initialisation at the start of the in-game action.
 void startLevelDone()
          Initialise next-level sequence.
 void startLifeLost()
          Initialise death sequence.
 void startStartGame()
          Initialise start-game sequence.
 void startStartLevel()
          Initialise start-level sequence.
 void startTitle()
          Initialise the title screen.
 
Methods inherited from class jgame.JGEngine
addGameState, and, andTileCid, checkBGCollision, checkBGCollision, checkCollision, clearGameState, clearKey, clearMouseButton, countObjects, countTiles, dbgExceptionToString, dbgPrint, dbgPrint, dbgSetDebugColor1, dbgSetDebugColor2, dbgSetMessageExpiry, dbgSetMessageFont, dbgShowBoundingBox, dbgShowException, dbgShowFullStackTrace, dbgShowGameState, dbgShowMessagesInPf, defineAnimation, defineAnimation, defineGraphics, defineImage, defineImage, defineImage, defineImage, defineImageMap, destroy, drawImage, drawImageString, drawLine, drawLine, drawOval, drawOval, drawRect, drawRect, drawString, drawString, existsObject, exitEngine, fillBG, getBufferGraphics, getFontHeight, getImage, getImageBBox, getImageSize, getKey, getKeyDesc, getMinScaleFactor, getMouseButton, getMouseInside, getMousePos, getMouseX, getMouseY, getObject, getTileCid, getTileCid, getTileCid, getTileCidAtCoord, getTileCoord, getTileCoord, getTileIndex, getTiles, getTileStr, getTileStr, getTileStrAtCoord, getXAlignOfs, getXScaleFactor, getYAlignOfs, getYScaleFactor, inGameState, inGameStateNextFrame, init, initEngine, initEngineApplet, initGame, isXAligned, isYAligned, moveObjects, moveObjects, orTileCid, pfHeight, pfTileHeight, pfTilesX, pfTilesY, pfTileWidth, pfWidth, random, random, random, removeAllTimers, removeGameState, removeObjects, setBGColor, setBGImage, setColor, setColorsFont, setCursor, setFGColor, setFont, setFont, setFrameRate, setGameState, setKey, setMouseButton, setMsgFont, setRenderSettings, setStroke, setTile, setTile, setTileCid, setTiles, setTileSettings, setTilesMulti, snapToGrid, snapToGridX, snapToGridY, start, stop, 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, addImpl, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getInsets, getLayout, getListeners, getMaximumSize, getMinimumSize, getPreferredSize, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paint, paintComponents, paramString, preferredSize, print, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, removeNotify, setFocusCycleRoot, setFocusTraversalKeys, setFocusTraversalPolicy, setLayout, transferFocusBackward, transferFocusDownCycle, update, validate, validateTree
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, disable, disableEvents, dispatchEvent, enable, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, 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, 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, isOpaque, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, printAll, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, reshape, setBackground, setBounds, setBounds, setComponentOrientation, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, setVisible, show, show, size, toString, transferFocus, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

key_startgame

public int key_startgame
Key for starting the game, default = space.


key_contgame

public int key_contgame
Key for continuing the game when in a sequence, default = space.


key_quitgame

public int key_quitgame
Key for quitting the game, default = escape.


key_pausegame

public int key_pausegame
Key for pausing the game, default = P.


key_left

public int key_left
Key for moving, default = cursors.


key_right

public int key_right
Key for moving, default = cursors.


key_up

public int key_up
Key for moving, default = cursors.


key_down

public int key_down
Key for moving, default = cursors.


key_upleft

public int key_upleft
Key for moving diagonally, default = none.


key_downleft

public int key_downleft
Key for moving diagonally, default = none.


key_upright

public int key_upright
Key for moving diagonally, default = none.


key_downright

public int key_downright
Key for moving diagonally, default = none.


key_fire

public int key_fire
Key for firing (in case there are no separate directional fire keys), default=Z.


key_fireleft

public int key_fireleft
Key for directional firing, default = WSAD keys


key_fireright

public int key_fireright
Key for directional firing, default = WSAD keys


key_fireup

public int key_fireup
Key for directional firing, default = WSAD keys


key_firedown

public int key_firedown
Key for directional firing, default = WSAD keys


key_fireupleft

public int key_fireupleft
Key for diagonal firing, default = none


key_firedownleft

public int key_firedownleft
Key for diagonal firing, default = none


key_fireupright

public int key_fireupright
Key for diagonal firing, default = none


key_firedownright

public int key_firedownright
Key for diagonal firing, default = none


key_action

public int[] key_action
Keys for special actions. Default = action[0]=ctrl, action[1]=alt


gametime

public int gametime
Game timer. Is reset to 0 at the beginning of each level, increments during InGame.


seqtimer

public int seqtimer
Sequence timer. Is reset to 0 at the start of the Title, StartLevel, StartGame, LevelDone, LifeLost, GameOver sequences. Counts always. Can be used to time animations for these sequences.


timer

public int timer
Animation timer. Always continues on counting. Can be used to time animations etc.


score

public int score
Player score; starts at 0 at beginning of game.


level

public int level
Difficulty level; starts at 0 at beginning of game. Can be incremented each time a level is complete. Can be used to determine game difficulty settings throughout the game.


stage

public int stage
Game stage, which is usually the same as level, but typically goes on counting, while level may stop increasing at a certain value. Can be used to vary graphic sets, display stage number, etc.


lives

public int lives
Lives count, 0 means game over.


initial_lives

public int initial_lives
Initial value for lives; default=4


startgame_ticks

public int startgame_ticks
Number of ticks to stay in StartLevel/StartGame state, 0 = skip


leveldone_ticks

public int leveldone_ticks
Number of ticks to stay in LevelDone state, 0 = skip


lifelost_ticks

public int lifelost_ticks
Number of ticks to stay in LifeLost state, 0 = skip


gameover_ticks

public int gameover_ticks
Number of ticks to stay in GameOver state, 0 = skip


startgame_ingame

public boolean startgame_ingame
Indicates whether the InGame state should be retained when in the corresponding sequence state.


leveldone_ingame

public boolean leveldone_ingame
Indicates whether the InGame state should be retained when in the corresponding sequence state.


lifelost_ingame

public boolean lifelost_ingame
Indicates whether the InGame state should be retained when in the corresponding sequence state.


gameover_ingame

public boolean gameover_ingame
Indicates whether the InGame state should be retained when in the corresponding sequence state.


status_font

public java.awt.Font status_font
Font to use to display score


status_color

public java.awt.Color status_color
Color to use to display score


lives_img

public java.lang.String lives_img
Image to use to display lives


title_font

public java.awt.Font title_font
Font to use to display title and messages


title_color

public java.awt.Color title_color
Color to use to display title and messages


title_bg_color

public java.awt.Color title_bg_color
Color to use to display background effects behind title and messages

Constructor Detail

StdGame

public StdGame()
Method Detail

setStatusDisplay

public void setStatusDisplay(java.awt.Font status_font,
                             java.awt.Color status_color,
                             java.lang.String lives_img)
Set the status display variables in one go.


setSequences

public void setSequences(boolean startgame_ingame,
                         int startgame_ticks,
                         boolean leveldone_ingame,
                         int leveldone_ticks,
                         boolean lifelost_ingame,
                         int lifelost_ticks,
                         boolean gameover_ingame,
                         int gameover_ticks)
Set all sequence variables in one go.


parseSizeArgs

public static java.awt.Dimension parseSizeArgs(java.lang.String[] args)
Parse the first two arguments assuming they are width and height.


initNewGame

public void initNewGame()
Initialise the game when a new game is started. Default sets level, stage, score to 0, and lives to initial_lives.


initNewLife

public void initNewLife()
Initialise play specifically after a new life is introduced (that is, at game start and after the player has died. This is typically used to reinitialise the player. If you want a specific initialisation at both the beginning of the level or after the player death, use startInGame(). Default is do nothing.


defineLevel

public void defineLevel()
Initialise a level. Default is do nothing.


decrementLives

public void decrementLives()
Code for losing a life before transition from LifeLost to InGame is made. Default is decrement lives.


incrementLevel

public void incrementLevel()
Code for incrementing a level before transition from LevelDone to InGame is made. Default is increment level and stage.


lifeLost

public final void lifeLost()
Call to make state transition to LifeLost. Is ignored when in another state than InGame or {InGame,StartLevel/StartGame}. After the LifeLost sequence, goes to InGame or GameOver, depending on lives left.


levelDone

public final void levelDone()
Call to make state transition to LevelDone. Is ignored when state is not InGame or {Ingame,StartLevel/StartGame}. After the LevelDone sequence, it sets gametime to 0, calls incrementLevel and defineLevel, and goes to StartLevel/StartGame.


gameOver

public final void gameOver()
Call to make straight transition to GameOver; is called automatically by lifeLost when appropriate. Is ignored when game state is not {InGame}, {Ingame,Start*}, or LifeLost. Will go to Title after GameOver sequence.


doFrame

public void doFrame()
The main doFrame takes care of all the standard game actions. If you override it, you should typically call super.doFrame(). doFrame increments timer, increments gametime when in InGame, quits game when key_quitgame is pressed in InGame. In Title, it waits for the user to press the key_startgame, then sets gametime to 0, calls initNewGame, defineLevel, and goes to StartLevel. It also handles the continue_game key inside the sequences.

Overrides:
doFrame in class JGEngine

startTitle

public void startTitle()
Initialise the title screen. This is a standard state transition function. Default is do nothing.


startInGame

public void startInGame()
Initialisation at the start of the in-game action. This is a standard state transition function. Note that it is always called after StartLevel and LifeLost, even if startgame_ingame and lifelost_ingame are set. Default is do nothing.


startStartLevel

public void startStartLevel()
Initialise start-level sequence. This is a standard state transition function. Default is do nothing.


startStartGame

public void startStartGame()
Initialise start-game sequence. This is a standard state transition function. Default is do nothing.


startLevelDone

public void startLevelDone()
Initialise next-level sequence. This is a standard state transition function. Default is do nothing.


startLifeLost

public void startLifeLost()
Initialise death sequence. This is a standard state transition function. Default is do nothing.


startGameOver

public void startGameOver()
Initialise game over sequence. This is a standard state transition function. Default is do nothing.


paintFrame

public void paintFrame()
Default paintFrame displays score at top left, lives at top right. When lives_img is set, it uses that image to display lives.

Overrides:
paintFrame in class JGEngine

paintFrameTitle

public void paintFrameTitle()
Default displays class name as title, and "press [key_startgame] to start" below it.


paintFramePaused

public void paintFramePaused()
The game is halted in pause mode, but the paintFrame is still done to refresh the screen. Default behaviour of paintFramePaused() is display "Paused", "Press [key_pausegame] to continue" using title_font, title_color


paintFrameStartLevel

public void paintFrameStartLevel()
Default displays "Level "+(stage+1).


paintFrameStartGame

public void paintFrameStartGame()
Default displays "Start !".


paintFrameLevelDone

public void paintFrameLevelDone()
Default displays "Level Done !".


paintFrameLifeLost

public void paintFrameLifeLost()
Default displays "Life Lost !".


paintFrameGameOver

public void paintFrameGameOver()
Default displays "Game Over!".


checkTime

public boolean checkTime(int min_time,
                         int max_time,
                         int increment)
Returns true every increment ticks, but only when gametime is between min_time and max_time.


checkTime

public boolean checkTime(int increment)
Returns true every increment ticks.


drawCount

public void drawCount(int count,
                      java.lang.String image,
                      int x,
                      int y,
                      int increment_x)
Draw a row of objects to indicate the value count. This is typically used to indicate lives left.


drawWavyString

public void drawWavyString(java.lang.String s,
                           int x,
                           int y,
                           int align,
                           int increment_x,
                           int tmr,
                           double amplitude,
                           double pos_phaseshift,
                           double timer_phaseshift,
                           java.awt.Font font,
                           java.awt.Color col)
Draw a string with letters that move up and down individually.


getZoomingFont

public java.awt.Font getZoomingFont(java.awt.Font basefont,
                                    int tmr,
                                    double min_size_fac,
                                    double speed)
Get font for zooming text in and out. Note that tmr = 0 will start the font zooming in from the farthest position.


cycleColor

public java.awt.Color cycleColor(java.awt.Color[] cycle,
                                 int tmr,
                                 double speed)
Get a colour from a colour cycle.


posWalkForwards

public int posWalkForwards(int begin_pos,
                           int end_pos,
                           int tmr,
                           int end_time,
                           int standstill_pos,
                           int standstill_time,
                           int standstill_count)
Walk across the screen, standing still momentarily at a specific position.