public class AnimatedEntity extends AbstractEntity implements Animatable
NAMELIST
GAME_DIAGLENGTH, GAME_DIAGLENGTH2, GAME_EDGELENGTH, OBJECTTYPESCOUNT, SCREEN_DEPTH, SCREEN_DEPTH2, SCREEN_DEPTH4, SCREEN_HEIGHT, SCREEN_HEIGHT2, SCREEN_HEIGHT4, SCREEN_WIDTH, SCREEN_WIDTH2, SCREEN_WIDTH4, VALUESCOUNT
Constructor and Description |
---|
AnimatedEntity(int id,
int value,
AbstractPosition pos,
int[] animationsinformation,
boolean autostart,
boolean loop)
Create an entity with an animation with an array wich has the time of every animation step in ms in it.
|
Modifier and Type | Method and Description |
---|---|
void |
start()
Starts the animation.
|
void |
stop()
Stops the animation.
|
void |
update(float delta)
updates the entity and the animation.
|
dispose, exist, getCategory, getDepth, getName, getPos, onGround, setHeight, setPos, shouldBeDisposed
getDimensionZ, getDrawCalls, getId, getLightlevel, getPixmap, getSprite, getSprites, getSpritesheet, getValue, increaseDrawCalls, isClipped, isHidden, isObstacle, isTransparent, loadSheet, prepareColor, render, render, render, render, render, render, render, resetDrawCalls, setClipped, setDimensionZ, setHidden, setLightlevel, setObstacle, setTransparent, setValue, staticDispose, updateStaticUpdates
public AnimatedEntity(int id, int value, AbstractPosition pos, int[] animationsinformation, boolean autostart, boolean loop)
id
- The id of the objectvalue
- the starting valuepos
- autostart
- True when it should automatically start.loop
- Set to true when it should loop, when false it stops after one time.animationsinformation
- the time in ms for each animation steppublic void update(float delta)
update
in class AbstractGameObject
delta
- the time wich has passed since last updatepublic void start()
Animatable
start
in interface Animatable
public void stop()
Animatable
stop
in interface Animatable