com.golden.gamedev
Class GameEngine

java.lang.Object
  |
  +--com.golden.gamedev.GameEngine

public abstract class GameEngine
extends Object

Abstract class that wrapping all available Game Engine.
This class also provide global variables that can access within all GameObject.

Any shared variables among all GameObject should place in here, such as game cursor, user properties, etc.
Title: Game Engine
Description: Engine for creating Java Games
Copyright: Copyright (c) 2004
Company: Golden T Corporation

Version:
1.0
Author:
Paulus Tuerah
See Also:
GameObject

Field Summary
 BaseGraphics bsGraphics
           
 BaseInput bsInput
           
 BaseIO bsIO
           
 BaseLoader bsLoader
           
 BaseAudio bsMusic
           
 BaseAudio bsSound
           
 BaseTimer bsTimer
           
 GameFontManager fontManager
           
 int nextGame
           
 
Constructor Summary
GameEngine(BaseGraphics gfx)
           
 
Method Summary
protected  void cleanup()
          Releases all game resources, and do finalization.
 GameObject currentGame()
           
 int currentGameID()
           
 void finish()
          End the game, and back to Operating System
 int getCurrentFPS()
           
abstract  GameObject getGame(int GameID)
          Returns GameObject with specific ID to be played next.
 int getHeight()
           
 int getRequestedFPS()
           
 int getWidth()
           
 void hideCursor()
           
protected  void initEngine()
           
 void playMusic(String audiofile)
           
 void playSound(String audiofile)
           
 void refresh()
          Refresh game global variables.
 void render(Graphics2D g)
          Common game render.
 void setFPS(int fps)
           
 void setMaskColor(Color c)
           
 void showCursor()
           
 void start()
          Starts the game, GameObject with ID = 1 will be the first game to be played.
 void update()
          Common game update.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

bsGraphics

public final BaseGraphics bsGraphics

bsIO

public BaseIO bsIO

bsLoader

public BaseLoader bsLoader

bsInput

public BaseInput bsInput

bsTimer

public BaseTimer bsTimer

bsMusic

public BaseAudio bsMusic

bsSound

public BaseAudio bsSound

fontManager

public GameFontManager fontManager

nextGame

public int nextGame
Constructor Detail

GameEngine

public GameEngine(BaseGraphics gfx)
Method Detail

initEngine

protected void initEngine()

getWidth

public int getWidth()

getHeight

public int getHeight()

playMusic

public void playMusic(String audiofile)

playSound

public void playSound(String audiofile)

setFPS

public void setFPS(int fps)

getCurrentFPS

public int getCurrentFPS()

getRequestedFPS

public int getRequestedFPS()

setMaskColor

public void setMaskColor(Color c)

hideCursor

public void hideCursor()

showCursor

public void showCursor()

start

public void start()
Starts the game, GameObject with ID = 1 will be the first game to be played.

See Also:
getGame(int GameID)

cleanup

protected void cleanup()
Releases all game resources, and do finalization.


refresh

public void refresh()
Refresh game global variables.


update

public void update()
Common game update.

The implementation of this method provided by the GameEngine does nothing.


render

public void render(Graphics2D g)
Common game render.

The implementation of this method provided by the GameEngine does nothing.

Parameters:
g - graphics backbuffer.

getGame

public abstract GameObject getGame(int GameID)
Returns GameObject with specific ID to be played next.

Parameters:
GameID - the id of the GameObject
Returns:
GameObject to be played next
See Also:
nextGame

finish

public void finish()
End the game, and back to Operating System


currentGameID

public int currentGameID()

currentGame

public GameObject currentGame()