public class AnimatedBlock extends Block implements Animatable
GAME_DIAGLENGTH, GAME_DIAGLENGTH2, GAME_EDGELENGTH, OBJECTTYPESNUM, SCREEN_DEPTH, SCREEN_DEPTH2, SCREEN_DEPTH4, SCREEN_HEIGHT, SCREEN_HEIGHT2, SCREEN_HEIGHT4, SCREEN_WIDTH, SCREEN_WIDTH2, SCREEN_WIDTH4, VALUESNUM
Constructor and Description |
---|
AnimatedBlock(int id,
int[] animationsinformation,
boolean autostart,
boolean loop)
Create this Block 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 block and the animation.
|
createBasicInstance, getBlockSprite, getBlocksprites, getCategory, getInstance, getInstance, getInstance, getName, getRepresentingColor, hasSides, isLiquid, render, render, render, render, renderSide, renderSide, renderSide, renderSide, setClipped, setNoSides, setSideClipping, staticDispose
getDrawCalls, getId, getLightlevel, getPixmap, getRotation, getSprite, getSprites, getSpritesheet, getValue, increaseDrawCalls, isClipped, isHidden, isObstacle, isTransparent, loadSheet, prepareColor, render, render, render, render, resetDrawCalls, setHidden, setLightlevel, setObstacle, setRotation, setTransparent, setValue, updateStaticUpdates
public AnimatedBlock(int id, int[] animationsinformation, boolean autostart, boolean loop)
id
- the id of the block.animationsinformation
- an array wich has the duraion of every animationstep insideautostart
- True when it should automatically start.loop
- Set to true when it should loop, when false it stops after one time.public void update(float delta)
public void start()
start
in interface Animatable
public void stop()
stop
in interface Animatable