|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--java.awt.Component | +--java.awt.Container | +--java.awt.Panel | +--java.applet.Applet | +--com.golden.gamedev.engine.graphics.HybridMode | +--com.golden.gamedev.Game
Golden T Game Engine (GTGE) Core Class, wrapping all available Game Engine.
Title: Game Engine
Description: Engine for creating Java Games
Copyright: Copyright (c) 2004
Company: Golden T Corporation
Field Summary | |
BaseGraphics |
bsGraphics
|
BaseInput |
bsInput
|
BaseIO |
bsIO
|
BaseLoader |
bsLoader
|
BaseAudio |
bsMusic
|
BaseAudio |
bsSound
|
BaseTimer |
bsTimer
|
GameFontManager |
fontManager
|
static String |
JAVA_VERSION
|
Fields inherited from class com.golden.gamedev.engine.graphics.HybridMode |
APPLET_MODE, FULLSCREEN_MODE, gc, WINDOW_MODE |
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 | |
Game()
Creates new instance of Game, please see note below. |
Method Summary | |
boolean |
checkPosMouse(int x1,
int y1,
int x2,
int y2)
|
boolean |
click()
|
protected void |
createEnvironment(boolean fullscreen,
boolean bufferstrategy)
|
void |
finish()
|
int |
getCurrentFPS()
|
int |
getHeight()
|
BufferedImage |
getImage(String imagefile)
|
BufferedImage |
getImage(String imagefile,
boolean useMask)
|
BufferedImage[] |
getImages(String imagefile,
int col,
int row)
|
BufferedImage[] |
getImages(String imagefile,
int col,
int row,
boolean useMask)
|
BufferedImage[] |
getImages(String imagefile,
int col,
int row,
boolean useMask,
int start,
int end)
|
BufferedImage[] |
getImages(String imagefile,
int col,
int row,
boolean useMask,
String sequence,
int digit)
|
BufferedImage[] |
getImages(String imagefile,
int col,
int row,
int start,
int end)
|
BufferedImage[] |
getImages(String imagefile,
int col,
int row,
String sequence,
int digit)
|
int |
getMouseX()
|
int |
getMouseY()
|
int |
getRandom(int low,
int hi)
|
int |
getRequestedFPS()
|
int |
getWidth()
|
void |
hideCursor()
|
protected void |
initEngine()
Game engine initialization. |
abstract void |
initResources()
|
boolean |
keyDown(int keyCode)
|
boolean |
keyPressed(int keyCode)
|
void |
paint(Graphics g)
Draw error messages, when user machine doesn't meet the minimum requirement. |
void |
playMusic(String audiofile)
Begins playback of specified audiofile as background music. |
void |
playSound(String audiofile)
Begins playback of specified audiofile as sound effect. |
abstract void |
render(Graphics2D g)
|
boolean |
rightClick()
|
void |
setFPS(int fps)
|
void |
setMaskColor(Color c)
|
void |
showCursor()
|
void |
start()
|
void |
stop()
|
BufferedImage |
takeScreenShot()
|
void |
takeScreenShot(File f)
|
abstract void |
update()
|
Methods inherited from class com.golden.gamedev.engine.graphics.HybridMode |
cleanup, flip, getBackBuffer, getComponent, getEnvironment, getEnvironmentString, getFrame, getSize, setup, setup |
Methods inherited from class java.applet.Applet |
destroy, getAccessibleContext, getAppletContext, getAppletInfo, getAudioClip, getAudioClip, getCodeBase, getDocumentBase, getImage, getImage, getLocale, getParameter, getParameterInfo, init, isActive, newAudioClip, play, play, resize, resize, setStub, showStatus |
Methods inherited from class java.awt.Panel |
addNotify |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
public static final String JAVA_VERSION
public final BaseGraphics bsGraphics
public BaseIO bsIO
public BaseLoader bsLoader
public BaseInput bsInput
public BaseTimer bsTimer
public BaseAudio bsMusic
public BaseAudio bsSound
public GameFontManager fontManager
Constructor Detail |
public Game()
Note: (instructions inherited from HybridMode
)
Do not make any overloading constructors for this class.
All game variables must be initialized within
initResources()
.
Game setup must be the first to setup after game creation,
setup(Dimension, fullscreen)
and
setup(Dimension, fullscreen, bufferstrategy)
.
(for Window and FullScreen mode only)
For example:
public class TestGame extends Game { // writes only empty constructor, // or simply don't write any constructor public TestGame() { } // do not use both of these // public TestGame(boolean fullscreen) { // setup(new Dimension(640,480), fullscreen); // } // public TestGame() { // setup(new Dimension(640,480), true); // } public void initResources() { // put game initialization in here } public static void main(String[] args) { Game game = new TestGame(); // creates new game // sets fullscreen mode, with 640 x 480 display mode game.setup(new Dimension(640,480), true); game.start(); // starts the game } }
initResources()
,
HybridMode.setup(Dimension, boolean)
,
HybridMode.setup(Dimension, boolean, boolean)
Method Detail |
protected void createEnvironment(boolean fullscreen, boolean bufferstrategy)
createEnvironment
in class HybridMode
protected void initEngine()
For example:
protected void initEngine() { super.initEngine(); bsTimer = new GageTimer(); // replace timer engine }
public void start()
start
in class HybridMode
public void stop()
stop
in class Applet
public void finish()
public abstract void initResources()
public abstract void update()
public abstract void render(Graphics2D g)
public int getRandom(int low, int hi)
public int getWidth()
getWidth
in class Component
public int getHeight()
getHeight
in class Component
public BufferedImage takeScreenShot()
public void takeScreenShot(File f)
public void playMusic(String audiofile)
initEngine()
. protected void initEngine() { super.initEngine(); // replace music audio engine bsMusic = new BaseAudio(bsIO, new MidiRenderer()); bsMusic.setExclusive(true); // only one can be played at a time bsMusic.setLoop(true); // music looping }
initEngine()
,
com.golden.gamedev.engine.audiopublic void playSound(String audiofile)
initEngine()
. protected void initEngine() { super.initEngine(); // replace sound audio engine bsSound = new BaseAudio(bsIO, new WaveRenderer()); }
initEngine()
,
com.golden.gamedev.engine.audiopublic void setFPS(int fps)
public int getCurrentFPS()
public int getRequestedFPS()
public int getMouseX()
public int getMouseY()
public boolean checkPosMouse(int x1, int y1, int x2, int y2)
public boolean click()
public boolean rightClick()
public boolean keyDown(int keyCode)
public boolean keyPressed(int keyCode)
public void hideCursor()
public void showCursor()
public void setMaskColor(Color c)
public BufferedImage getImage(String imagefile, boolean useMask)
public BufferedImage getImage(String imagefile)
public BufferedImage[] getImages(String imagefile, int col, int row, boolean useMask)
public BufferedImage[] getImages(String imagefile, int col, int row)
public BufferedImage[] getImages(String imagefile, int col, int row, boolean useMask, String sequence, int digit)
public BufferedImage[] getImages(String imagefile, int col, int row, String sequence, int digit)
public BufferedImage[] getImages(String imagefile, int col, int row, boolean useMask, int start, int end)
public BufferedImage[] getImages(String imagefile, int col, int row, int start, int end)
public void paint(Graphics g)
paint
in class Container
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |