public abstract class GameContainer
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
protected Graphics |
graphics |
protected int |
height |
static float |
MAXIMUM_DELTA |
static int |
TARGET_FPS |
protected int |
width |
Constructor and Description |
---|
GameContainer() |
Modifier and Type | Method and Description |
---|---|
void |
addResizeListener(GameResizeListener listener) |
void |
dispose() |
int |
getHeight() |
int |
getWidth() |
abstract void |
initialise()
Initialise the game
|
void |
interpolate(float alpha)
Interpolate the game state
|
abstract void |
onPause() |
abstract void |
onResume() |
protected void |
postinit()
Internal post-initialisation code
|
protected void |
preinit(Graphics g)
Internal pre-initialisation code
|
void |
preUpdate(float delta)
Called by mini2Dx pre-update
|
void |
removeResizeListener(GameResizeListener listener) |
void |
render() |
abstract void |
render(Graphics g)
Render the game
|
void |
resize(int width,
int height) |
void |
start(Graphics g) |
abstract void |
update(float delta)
Update the game
|
public static final int TARGET_FPS
public static final float MAXIMUM_DELTA
protected int width
protected int height
protected Graphics graphics
public abstract void initialise()
public void preUpdate(float delta)
delta
- The time in seconds since the last updatepublic abstract void update(float delta)
delta
- The time in seconds since the last updatepublic void interpolate(float alpha)
alpha
- The alpha value to use during interpolationpublic abstract void render(Graphics g)
g
- The Graphics
context available for renderingpublic abstract void onPause()
public abstract void onResume()
public void render()
public void resize(int width, int height)
protected void preinit(Graphics g)
protected void postinit()
public void start(Graphics g)
public void dispose()
public void addResizeListener(GameResizeListener listener)
public void removeResizeListener(GameResizeListener listener)
public int getWidth()
public int getHeight()