Package net.egartley.beyondorigins
Class Game
- java.lang.Object
-
- org.newdawn.slick.state.StateBasedGame
-
- net.egartley.beyondorigins.Game
-
- All Implemented Interfaces:
org.newdawn.slick.command.InputProviderListener
,org.newdawn.slick.ControlledInputReciever
,org.newdawn.slick.ControllerListener
,org.newdawn.slick.Game
,org.newdawn.slick.InputListener
,org.newdawn.slick.KeyListener
,org.newdawn.slick.MouseListener
public class Game extends org.newdawn.slick.state.StateBasedGame implements org.newdawn.slick.command.InputProviderListener
The "main" class, mostly for interacting with the Slick2D library
-
-
Field Summary
Fields Modifier and Type Field Description static boolean
debug
Whether or not to perform debug related operationsstatic org.newdawn.slick.Input
input
Allows for keyboard, mouse and controller input to be readstatic int
WINDOW_HEIGHT
The "actual" height of the window (minus 1px borders)static int
WINDOW_WIDTH
The "actual" width of the window (minus 1px borders)
-
Constructor Summary
Constructors Constructor Description Game()
Calls the constructor forStateBasedGame
with a custom title
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
controlPressed(org.newdawn.slick.command.Command command)
void
controlReleased(org.newdawn.slick.command.Command command)
void
initStatesList(org.newdawn.slick.GameContainer container)
void
keyPressed(int key, char c)
void
keyReleased(int key, char c)
static void
main(java.lang.String[] args)
Creates a newAppGameContainer
and starts itvoid
mouseClicked(int button, int x, int y, int clickCount)
void
mouseDragged(int oldx, int oldy, int newx, int newy)
void
mouseMoved(int oldx, int oldy, int newx, int newy)
void
mousePressed(int button, int x, int y)
void
mouseReleased(int button, int x, int y)
void
mouseWheelMoved(int change)
static void
quit()
Quits the game-
Methods inherited from class org.newdawn.slick.state.StateBasedGame
addState, closeRequested, controllerButtonPressed, controllerButtonReleased, controllerDownPressed, controllerDownReleased, controllerLeftPressed, controllerLeftReleased, controllerRightPressed, controllerRightReleased, controllerUpPressed, controllerUpReleased, enterState, enterState, getContainer, getCurrentState, getCurrentStateID, getState, getStateCount, getTitle, init, inputEnded, inputStarted, isAcceptingInput, postRenderState, postUpdateState, preRenderState, preUpdateState, render, setInput, update
-
-
-
-
Field Detail
-
WINDOW_WIDTH
public static final int WINDOW_WIDTH
The "actual" width of the window (minus 1px borders)- See Also:
- Constant Field Values
-
WINDOW_HEIGHT
public static final int WINDOW_HEIGHT
The "actual" height of the window (minus 1px borders)- See Also:
- Constant Field Values
-
debug
public static boolean debug
Whether or not to perform debug related operations
-
input
public static org.newdawn.slick.Input input
Allows for keyboard, mouse and controller input to be read
-
-
Method Detail
-
main
public static void main(java.lang.String[] args)
Creates a newAppGameContainer
and starts it- Parameters:
args
- Arguments supplied through command line/execution
-
initStatesList
public void initStatesList(org.newdawn.slick.GameContainer container) throws org.newdawn.slick.SlickException
- Specified by:
initStatesList
in classorg.newdawn.slick.state.StateBasedGame
- Throws:
org.newdawn.slick.SlickException
-
quit
public static void quit()
Quits the game
-
mousePressed
public void mousePressed(int button, int x, int y)
- Specified by:
mousePressed
in interfaceorg.newdawn.slick.MouseListener
- Overrides:
mousePressed
in classorg.newdawn.slick.state.StateBasedGame
-
mouseReleased
public void mouseReleased(int button, int x, int y)
- Specified by:
mouseReleased
in interfaceorg.newdawn.slick.MouseListener
- Overrides:
mouseReleased
in classorg.newdawn.slick.state.StateBasedGame
-
mouseMoved
public void mouseMoved(int oldx, int oldy, int newx, int newy)
- Specified by:
mouseMoved
in interfaceorg.newdawn.slick.MouseListener
- Overrides:
mouseMoved
in classorg.newdawn.slick.state.StateBasedGame
-
mouseDragged
public void mouseDragged(int oldx, int oldy, int newx, int newy)
- Specified by:
mouseDragged
in interfaceorg.newdawn.slick.MouseListener
- Overrides:
mouseDragged
in classorg.newdawn.slick.state.StateBasedGame
-
mouseWheelMoved
public void mouseWheelMoved(int change)
- Specified by:
mouseWheelMoved
in interfaceorg.newdawn.slick.MouseListener
- Overrides:
mouseWheelMoved
in classorg.newdawn.slick.state.StateBasedGame
-
keyPressed
public void keyPressed(int key, char c)
- Specified by:
keyPressed
in interfaceorg.newdawn.slick.KeyListener
- Overrides:
keyPressed
in classorg.newdawn.slick.state.StateBasedGame
-
keyReleased
public void keyReleased(int key, char c)
- Specified by:
keyReleased
in interfaceorg.newdawn.slick.KeyListener
- Overrides:
keyReleased
in classorg.newdawn.slick.state.StateBasedGame
-
mouseClicked
public void mouseClicked(int button, int x, int y, int clickCount)
- Specified by:
mouseClicked
in interfaceorg.newdawn.slick.MouseListener
- Overrides:
mouseClicked
in classorg.newdawn.slick.state.StateBasedGame
-
controlPressed
public void controlPressed(org.newdawn.slick.command.Command command)
- Specified by:
controlPressed
in interfaceorg.newdawn.slick.command.InputProviderListener
-
controlReleased
public void controlReleased(org.newdawn.slick.command.Command command)
- Specified by:
controlReleased
in interfaceorg.newdawn.slick.command.InputProviderListener
-
-