public class AnimatedBlock extends RenderBlock implements Animatable
GAME_DIAGLENGTH, GAME_DIAGLENGTH2, GAME_EDGELENGTH, GAME_EDGELENGTH2, OBJECTTYPESNUM, VALUESNUM, VIEW_DEPTH, VIEW_DEPTH2, VIEW_DEPTH4, VIEW_HEIGHT, VIEW_HEIGHT2, VIEW_HEIGHT4, VIEW_WIDTH, VIEW_WIDTH2, VIEW_WIDTH4, ZAXISSHORTENING
Constructor and Description |
---|
AnimatedBlock(byte id,
int[] animationsinformation,
boolean autostart,
boolean loop)
Create this RenderBlock with an array wich has the time of every animation step in ms in it.
|
Modifier and Type | Method and Description |
---|---|
void |
setBounce(boolean bob)
play the animation back and forth
|
void |
start()
Starts the animation.
|
void |
stop()
Stops the animation.
|
void |
update(float dt)
updates the block and the animation.
|
getBlockSprite, getBlocksprites, getCategory, getDimensionZ, getName, getPosition, getRepresentingColor, hidingPastBlock, isClipped, isObstacle, isTransparent, onDestroy, render, render, render, renderSide, renderSide, renderSide, setClippedLeft, setClippedRight, setClippedTop, setDestructionSound, setPosition, spawn, staticDispose, toStorageBlock
getAtlasRegion, getColor, getCoreData, getDepth, getDrawCalls, getHealth, getId, getLightlevel, getPixmap, getRotation, getScaling, getSprite, getSpriteId, getSprites, getSpritesheet, getSpritesheetPath, getTextureDiffuse, getTextureNormal, getValue, increaseDrawCalls, isHidden, loadSheet, render, render, resetDrawCalls, setColor, setCustomSpritesheet, setGraphicsId, setHealth, setHidden, setLightlevel, setRotation, setScaling, setValue
public AnimatedBlock(byte 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 setBounce(boolean bob)
bob
- public void update(float dt)
update
in class RenderBlock
dt
- the time wich has passed since last updatepublic void start()
start
in interface Animatable
public void stop()
stop
in interface Animatable