Class AnimatedBlock
- java.lang.Object
-
- com.badlogic.gdx.graphics.g3d.Renderable
-
- com.bombinggames.wurfelengine.core.gameobjects.AbstractGameObject
-
- com.bombinggames.wurfelengine.core.map.rendering.RenderCell
-
- com.bombinggames.wurfelengine.core.map.rendering.AnimatedBlock
-
- All Implemented Interfaces:
Animatable
- Direct Known Subclasses:
Sea
public class AnimatedBlock extends RenderCell implements Animatable
A block which has an animation.- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class com.bombinggames.wurfelengine.core.map.rendering.RenderCell
RenderCell.Channel
-
-
Field Summary
-
Fields inherited from class com.bombinggames.wurfelengine.core.gameobjects.AbstractGameObject
sprite
-
Fields inherited from class com.badlogic.gdx.graphics.g3d.Renderable
bones, environment, material, meshPart, shader, userData, worldTransform
-
Fields inherited from class com.bombinggames.wurfelengine.core.map.rendering.RenderCell
GAME_DIAGLENGTH, GAME_DIAGLENGTH2, GAME_EDGELENGTH, GAME_EDGELENGTH2, OBJECTTYPESNUM, PROJECTIONFACTORY, PROJECTIONFACTORZ, VALUESNUM, VIEW_DEPTH, VIEW_DEPTH2, VIEW_DEPTH4, VIEW_HEIGHT, VIEW_HEIGHT2, VIEW_HEIGHT4, VIEW_WIDTH, VIEW_WIDTH2, VIEW_WIDTH4
-
-
Constructor Summary
Constructors Constructor Description AnimatedBlock(byte id, byte value, int[] animationsinformation, boolean autostart, boolean loop)
Create this RenderCell with an array wich has the time of every animation step in ms in it.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
setBounce(boolean bob)
play the animation back and forthvoid
start()
Starts the animation.void
stop()
Stops the animation.void
update(float dt)
updates the block and the animation.-
Methods inherited from class com.bombinggames.wurfelengine.core.gameobjects.AbstractGameObject
getColor, getDepth, getPixmap, getRotation, getScaling, getSprite, getSprite, getSpritesheet, getSpritesheetPath, getTextureDiffuse, getTextureNormal, isHidden, loadSheet, setColor, setCustomSpritesheet, setHidden, setRotation, setScaling
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from class com.bombinggames.wurfelengine.core.map.rendering.RenderCell
addLightlevel, getAOFlags, getBlockSprite, getBlocksprites, getClipping, getCoord, getDimensionZ, getHealth, getHealth, getId, getLightlevel, getLightlevelB, getLightlevelG, getLightlevelR, getName, getName, getPoint, getPosition, getRepresentingColor, getSpriteCategory, getSpriteId, getSpriteValue, getTopoNode, getValue, hasSides, hidingPastBlock, isFullyClipped, isIndestructible, isLiquid, isLiquid, isObstacle, isSpriteDefined, isTransparent, isTransparent, newInstance, render, render, render, renderSide, renderSide, renderSide, resetLight, setAOFlagFalse, setAoFlags, setAOFlagTrue, setClippedLeft, setClippedRight, setClippedTop, setLightlevel, setLightlevel, setLightlevel, setLightlevel, setPosition, setPosition, setStaticShade, setUnclipped, setValue, shouldBeRendered, spawn, staticDispose, toString, updateSpriteCache
-
-
-
-
Constructor Detail
-
AnimatedBlock
public AnimatedBlock(byte id, byte value, int[] animationsinformation, boolean autostart, boolean loop)
Create this RenderCell with an array wich has the time of every animation step in ms in it.- Parameters:
id
-value
-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.
-
-
Method Detail
-
setBounce
public void setBounce(boolean bob)
play the animation back and forth- Parameters:
bob
-
-
update
public void update(float dt)
updates the block and the animation.- Overrides:
update
in classRenderCell
- Parameters:
dt
- the time wich has passed since last update
-
start
public void start()
Starts the animation.- Specified by:
start
in interfaceAnimatable
-
stop
public void stop()
Stops the animation.- Specified by:
stop
in interfaceAnimatable
-
-