public class TileLevel
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
(package private) org.newdawn.slick.GameContainer |
gc |
private org.newdawn.slick.Image |
mapImage |
private int |
mapImageHeight |
private java.lang.String |
mapImagePath |
private int |
mapImageWidth |
private Tile |
nullTile |
private int |
nullTileID |
private int[] |
pixelsOnMapImage |
private int |
screenHeight |
private int |
screenWidth |
private int |
shiftCount |
private int[] |
tileIdMap |
private Tile[] |
tileMap |
private java.util.List<Tile> |
tileSet |
private int |
xOffset |
private int |
yOffset |
Constructor and Description |
---|
TileLevel(Tile[] tileSet,
java.lang.String mapImagePath,
Tile nullTile) |
TileLevel(Tile[] tileSet,
java.lang.String mapImagePath,
Tile nullTile,
org.newdawn.slick.GameContainer gc) |
Modifier and Type | Method and Description |
---|---|
private void |
fillTile()
Creates an array of tiles to be rendered
|
int |
getHeight() |
int |
getShiftCount() |
Tile |
getTileAt(int x,
int y) |
Tile[] |
getTileMap() |
int |
getWidth() |
int |
getXOffset() |
int |
getYOffset() |
private void |
loadImage(java.lang.String mapImagePath) |
void |
Render()
Renders the tile level onto the screen
|
void |
Update(int DELTA,
int xOffset,
int yOffset) |
private java.lang.String mapImagePath
private int mapImageHeight
private int mapImageWidth
private org.newdawn.slick.Image mapImage
private int[] pixelsOnMapImage
private int screenWidth
private int screenHeight
org.newdawn.slick.GameContainer gc
private int[] tileIdMap
private Tile[] tileMap
private int shiftCount
private java.util.List<Tile> tileSet
private Tile nullTile
private int nullTileID
private int xOffset
private int yOffset
private void loadImage(java.lang.String mapImagePath)
mapImagePath
- the path to the image of the map
Loads the image and creates an array of colorsprivate void fillTile()
public void Update(int DELTA, int xOffset, int yOffset)
DELTA
- the delta variable to be used in updatingxOffset
- how far the map should be offset on the x axisyOffset
- how far the map should be offset on the y axis
Handles updating tiles and updating the x and y offsetspublic void Render()
public int getXOffset()
public int getYOffset()
public Tile getTileAt(int x, int y)
x
- the x variable in pixels of the window that should be testedy
- the y vaiable in pixels of the window that should be testedpublic Tile[] getTileMap()
public int getWidth()
public int getHeight()
public int getShiftCount()