public abstract class AbstractEntity extends AbstractGameObject implements IsSelfAware
GAME_DIAGLENGTH, GAME_DIAGLENGTH2, GAME_EDGELENGTH, GAME_EDGELENGTH2, OBJECTTYPESNUM, SCREEN_DEPTH, SCREEN_DEPTH2, SCREEN_DEPTH4, SCREEN_HEIGHT, SCREEN_HEIGHT2, SCREEN_HEIGHT4, SCREEN_WIDTH, SCREEN_WIDTH2, SCREEN_WIDTH4, VALUESNUM
Modifier | Constructor and Description |
---|---|
protected |
AbstractEntity(int id)
Create an abstractEntity.
|
Modifier and Type | Method and Description |
---|---|
void |
dispose()
Deletes the object from the map.
|
char |
getCategory()
Get the category letter for accessing sprites.
|
int |
getDimensionZ() |
java.lang.String |
getName()
Returns the name of the object
|
Point |
getPosition()
Return the coordinates of the SelfAware object.
|
boolean |
isOnGround()
Is the entity laying/standing on the ground?
|
void |
render(GameView view,
Camera camera)
renders using it's saved postion
|
void |
save(java.io.Writer writer) |
void |
setDimensionZ(int dimensionZ)
Set the height of the object.
|
void |
setHeight(float height) |
void |
setPosition(AbstractPosition pos)
Set the coordinates without safety check.
|
boolean |
shouldBeDisposed() |
AbstractEntity |
spawn(Point point)
add this entity to the map-> let it spawn
|
boolean |
spawned()
Is the object active on the map?
|
abstract void |
update(float delta)
Updates the logic of the object.
|
getDrawCalls, getHealth, getId, getLightlevel, getPixmap, getRotation, getSprite, getSpriteId, getSprites, getSpritesheet, getValue, increaseDrawCalls, isHidden, isObstacle, isTransparent, loadSheet, render, render, render, render, render, render, render, resetDrawCalls, setGraphicsId, setHealth, setHidden, setLightlevel, setObstacle, setRotation, setTransparent, setValue, staticDispose, updateStaticUpdates
protected AbstractEntity(int id)
id
- public abstract void update(float delta)
delta
- time since last updatepublic Point getPosition()
IsSelfAware
getPosition
in interface IsSelfAware
public void setPosition(AbstractPosition pos)
IsSelfAware
setPosition
in interface IsSelfAware
pos
- the coordinates you want to setpublic void setHeight(float height)
height
- public boolean isOnGround()
public AbstractEntity spawn(Point point)
point
- public boolean spawned()
public char getCategory()
AbstractGameObject
getCategory
in class AbstractGameObject
public java.lang.String getName()
AbstractGameObject
getName
in class AbstractGameObject
public void setDimensionZ(int dimensionZ)
dimensionZ
- public int getDimensionZ()
public void dispose()
shouldBeDisposed()
public boolean shouldBeDisposed()
dispose()
public void render(GameView view, Camera camera)
view
- camera
- public void save(java.io.Writer writer) throws java.io.IOException
java.io.IOException