org.newdawn.slick.tests.states
Class TestState1

java.lang.Object
  extended by org.newdawn.slick.state.BasicGameState
      extended by org.newdawn.slick.tests.states.TestState1
All Implemented Interfaces:
ControlledInputReciever, ControllerListener, InputListener, KeyListener, MouseListener, GameState

public class TestState1
extends BasicGameState

A simple test state to display a message describing the test

Author:
kevin

Field Summary
static int ID
          The ID given to this state
 
Constructor Summary
TestState1()
           
 
Method Summary
 int getID()
          Get the ID of this state
 void init(GameContainer container, StateBasedGame game)
          Initialise the state.
 void keyReleased(int key, char c)
          Notification that a key was released
 void render(GameContainer container, StateBasedGame game, Graphics g)
          Render this state to the game's graphics context
 void update(GameContainer container, StateBasedGame game, int delta)
          Update the state's logic based on the amount of time thats passed
 
Methods inherited from class org.newdawn.slick.state.BasicGameState
controllerButtonPressed, controllerButtonReleased, controllerDownPressed, controllerDownReleased, controllerLeftPressed, controllerLeftReleased, controllerRightPressed, controllerRightReleased, controllerUpPressed, controllerUpReleased, enter, inputEnded, inputStarted, isAcceptingInput, keyPressed, leave, mouseClicked, mouseDragged, mouseMoved, mousePressed, mouseReleased, mouseWheelMoved, setInput
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ID

public static final int ID
The ID given to this state

See Also:
Constant Field Values
Constructor Detail

TestState1

public TestState1()
Method Detail

getID

public int getID()
Description copied from interface: GameState
Get the ID of this state

Specified by:
getID in interface GameState
Specified by:
getID in class BasicGameState
Returns:
The game unique ID of this state
See Also:
BasicGameState.getID()

init

public void init(GameContainer container,
                 StateBasedGame game)
          throws SlickException
Description copied from interface: GameState
Initialise the state. It should load any resources it needs at this stage

Parameters:
container - The container holding the game
game - The game holding this state
Throws:
SlickException - Indicates a failure to initialise a resource for this state
See Also:
GameState.init(org.newdawn.slick.GameContainer, org.newdawn.slick.state.StateBasedGame)

render

public void render(GameContainer container,
                   StateBasedGame game,
                   Graphics g)
Description copied from interface: GameState
Render this state to the game's graphics context

Parameters:
container - The container holding the game
game - The game holding this state
g - The graphics context to render to
See Also:
GameState.render(org.newdawn.slick.GameContainer, org.newdawn.slick.state.StateBasedGame, org.newdawn.slick.Graphics)

update

public void update(GameContainer container,
                   StateBasedGame game,
                   int delta)
Description copied from interface: GameState
Update the state's logic based on the amount of time thats passed

Parameters:
container - The container holding the game
game - The game holding this state
delta - The amount of time thats passed in millisecond since last update
See Also:
GameState.update(org.newdawn.slick.GameContainer, org.newdawn.slick.state.StateBasedGame, int)

keyReleased

public void keyReleased(int key,
                        char c)
Description copied from interface: KeyListener
Notification that a key was released

Specified by:
keyReleased in interface KeyListener
Overrides:
keyReleased in class BasicGameState
Parameters:
key - The key code that was released (@see org.newdawn.slick.Input)
c - The character of the key that was released
See Also:
BasicGameState.keyReleased(int, char)


Copyright © 2006 New Dawn Software. All Rights Reserved.