public abstract class Tile
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
private int |
elapsedTime |
private int |
id |
private int |
mapColor |
private int |
size |
private boolean |
solid |
private TileSprite |
sprite |
Constructor and Description |
---|
Tile(int id,
TileSprite sprite) |
Tile(int id,
TileSprite sprite,
boolean solid) |
Tile(int id,
TileSprite sprite,
boolean solid,
int mapColor) |
Tile(int id,
TileSprite sprite,
int mapColor) |
Modifier and Type | Method and Description |
---|---|
int |
getId() |
static int |
getId(Tile tile) |
int |
getLevelColor() |
int |
getSize() |
boolean |
getSolid() |
TileSprite |
getSprite() |
void |
render(int x,
int y) |
void |
setId(int id) |
void |
setSolid(boolean solid) |
void |
setSprite(TileSprite sprite) |
int |
timeToFrameUpdate() |
void |
update(int delta) |
private int id
private boolean solid
private TileSprite sprite
private int elapsedTime
private int mapColor
private int size
public Tile(int id, TileSprite sprite)
public Tile(int id, TileSprite sprite, boolean solid)
public Tile(int id, TileSprite sprite, boolean solid, int mapColor)
public Tile(int id, TileSprite sprite, int mapColor)
public void render(int x, int y)
x
- the location to draw the tiley
- the location to draw the tile
Render the tile at the specified location.
Not to be called directly by the developer.public void update(int delta)
delta
- the delta variable to be used in animation
Update the tile's animation looppublic int getId()
public static int getId(Tile tile)
tile
- the tile to be testedpublic boolean getSolid()
public void setSolid(boolean solid)
solid
- if the tile is solid (collidable)public TileSprite getSprite()
public void setId(int id)
id
- the id the tile should be set topublic void setSprite(TileSprite sprite)
sprite
- the Tile sprite imagepublic int timeToFrameUpdate()
public int getLevelColor()
public int getSize()