public abstract class GameContainer
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
protected Graphics |
graphics |
protected int |
height |
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 physics
|
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
|
void |
preUpdatePhysics(float delta)
Called by mini2Dx
|
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
|
void |
updatePhysics(float delta)
Update the game physics
|
public static int TARGET_FPS
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 void preUpdatePhysics(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 updatePhysics(float delta)
delta
- The time in seconds to advance the physics bypublic 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()