org.newdawn.slick
Interface Game

All Known Implementing Classes:
AlphaMapTest, AnimationTest, AntiAliasTest, BasicGame, BigImageTest, BigSpriteSheetTest, CachedRenderTest, CanvasContainerTest, CanvasSizeTest, ClipTest, CopyAreaAlphaTest, CurveTest, DeferredLoadingTest, DistanceFieldTest, DoubleClickTest, DuplicateEmitterTest, FlashTest, FontPerformanceTest, FontTest, GeomAccuracyTest, GeomTest, GeomUtilTest, GeomUtilTileTest, GradientImageTest, GradientTest, GraphicsTest, GUITest, ImageBufferEndianTest, ImageBufferTest, ImageCornerTest, ImageGraphicsTest, ImageMemTest, ImageOutTest, ImageReadTest, ImageTest, InkscapeTest, InputProviderTest, InputTest, IsoTiledTest, KeyRepeatTest, LameTest, LineRenderTest, MorphShapeTest, MorphSVGTest, MusicListenerTest, NavMeshTest, PackedSheetTest, ParticleTest, PedigreeTest, PolygonTest, PureFontTest, SavedStateTest, ScalableGame, ScalableTest, ShapeTest, SlickCallableTest, SoundPositionTest, SoundTest, SoundURLTest, SpriteSheetFontTest, StateBasedGame, StateBasedTest, TestBox, TexturePaintTest, TileMapTest, TransformTest, TransformTest2, TransitionTest, TransparentColorTest, TrueTypeFontPerformanceTest, UnicodeFontTest

public interface Game

The main game interface that should be implemented by any game being developed using the container system. There will be some utility type sub-classes as development continues.

Author:
kevin
See Also:
BasicGame

Method Summary
 boolean closeRequested()
          Notification that a game close has been requested
 java.lang.String getTitle()
          Get the title of this game
 void init(GameContainer container)
          Initialise the game.
 void render(GameContainer container, Graphics g)
          Render the game's screen here.
 void update(GameContainer container, int delta)
          Update the game logic here.
 

Method Detail

init

void init(GameContainer container)
          throws SlickException
Initialise the game. This can be used to load static resources. It's called before the game loop starts

Parameters:
container - The container holding the game
Throws:
SlickException - Throw to indicate an internal error

update

void update(GameContainer container,
            int delta)
            throws SlickException
Update the game logic here. No rendering should take place in this method though it won't do any harm.

Parameters:
container - The container holing this game
delta - The amount of time thats passed since last update in milliseconds
Throws:
SlickException - Throw to indicate an internal error

render

void render(GameContainer container,
            Graphics g)
            throws SlickException
Render the game's screen here.

Parameters:
container - The container holing this game
g - The graphics context that can be used to render. However, normal rendering routines can also be used.
Throws:
SlickException - Throw to indicate a internal error

closeRequested

boolean closeRequested()
Notification that a game close has been requested

Returns:
True if the game should close

getTitle

java.lang.String getTitle()
Get the title of this game

Returns:
The title of the game


Copyright © 2006 New Dawn Software. All Rights Reserved.