org.newdawn.slick.tests
Class NavMeshTest

java.lang.Object
  extended by org.newdawn.slick.BasicGame
      extended by org.newdawn.slick.tests.NavMeshTest
All Implemented Interfaces:
ControlledInputReciever, ControllerListener, Game, InputListener, KeyListener, MouseListener, PathFindingContext

public class NavMeshTest
extends BasicGame
implements PathFindingContext

A test to show nav-mesh generation on tile based maps.

Author:
kevin

Field Summary
 
Fields inherited from class org.newdawn.slick.BasicGame
controllerButton, controllerDown, controllerLeft, controllerRight, controllerUp
 
Constructor Summary
NavMeshTest()
          Create a new test
 
Method Summary
 Mover getMover()
          Get the object being moved along the path if any
 int getSearchDistance()
          Get the distance that has been searched to reach this point
 int getSourceX()
          Get the x coordinate of the source location
 int getSourceY()
          Get the y coordinate of the source location
 void init(GameContainer container)
          Initialise resources and the map data
static void main(java.lang.String[] argv)
          Entry point to out application
 void mousePressed(int button, int x, int y)
          Notification that a mouse button was pressed
 void render(GameContainer container, Graphics g)
          Render the game - in this case render the map and diagnostic data
 void update(GameContainer container, int delta)
          Update data map etc
 
Methods inherited from class org.newdawn.slick.BasicGame
closeRequested, controllerButtonPressed, controllerButtonReleased, controllerDownPressed, controllerDownReleased, controllerLeftPressed, controllerLeftReleased, controllerRightPressed, controllerRightReleased, controllerUpPressed, controllerUpReleased, getTitle, inputEnded, inputStarted, isAcceptingInput, keyPressed, keyReleased, mouseClicked, mouseDragged, mouseMoved, mouseReleased, mouseWheelMoved, setInput
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NavMeshTest

public NavMeshTest()
Create a new test

Method Detail

init

public void init(GameContainer container)
          throws SlickException
Initialise resources and the map data

Specified by:
init in interface Game
Specified by:
init in class BasicGame
Parameters:
container - the container the game is running in
Throws:
SlickException - Throw to indicate an internal error
See Also:
Game.init(org.newdawn.slick.GameContainer)

update

public void update(GameContainer container,
                   int delta)
            throws SlickException
Update data map etc

Specified by:
update in interface Game
Specified by:
update in class BasicGame
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
See Also:
Game.update(org.newdawn.slick.GameContainer, int)

render

public void render(GameContainer container,
                   Graphics g)
            throws SlickException
Render the game - in this case render the map and diagnostic data

Specified by:
render in interface Game
Parameters:
container - The container we're running the game in
g - The graphics context on which to render
Throws:
SlickException - Throw to indicate a internal error

getMover

public Mover getMover()
Description copied from interface: PathFindingContext
Get the object being moved along the path if any

Specified by:
getMover in interface PathFindingContext
Returns:
The object being moved along the path

getSearchDistance

public int getSearchDistance()
Description copied from interface: PathFindingContext
Get the distance that has been searched to reach this point

Specified by:
getSearchDistance in interface PathFindingContext
Returns:
The distance that has been search to reach this point

getSourceX

public int getSourceX()
Description copied from interface: PathFindingContext
Get the x coordinate of the source location

Specified by:
getSourceX in interface PathFindingContext
Returns:
The x coordinate of the source location

getSourceY

public int getSourceY()
Description copied from interface: PathFindingContext
Get the y coordinate of the source location

Specified by:
getSourceY in interface PathFindingContext
Returns:
The y coordinate of the source location

mousePressed

public void mousePressed(int button,
                         int x,
                         int y)
Description copied from interface: MouseListener
Notification that a mouse button was pressed

Specified by:
mousePressed in interface MouseListener
Overrides:
mousePressed in class BasicGame
Parameters:
button - The index of the button (starting at 0)
x - The x position of the mouse when the button was pressed
y - The y position of the mouse when the button was pressed
See Also:
MouseListener.mousePressed(int, int, int)

main

public static void main(java.lang.String[] argv)
Entry point to out application

Parameters:
argv - The arguments passed to the application


Copyright © 2006 New Dawn Software. All Rights Reserved.