Class ParticleEmitter
- java.lang.Object
-
- com.badlogic.gdx.graphics.g3d.Renderable
-
- com.bombinggames.wurfelengine.core.gameobjects.AbstractGameObject
-
- com.bombinggames.wurfelengine.core.gameobjects.AbstractEntity
-
- com.bombinggames.wurfelengine.core.gameobjects.ParticleEmitter
-
public class ParticleEmitter extends AbstractEntity
Light is per default disabled.- See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from class com.bombinggames.wurfelengine.core.gameobjects.AbstractEntity
colissionRadius
-
Fields inherited from class com.bombinggames.wurfelengine.core.gameobjects.AbstractGameObject
sprite
-
-
Constructor Summary
Constructors Constructor Description ParticleEmitter()Initializes with defautl sizeParticleEmitter(int size)active by default
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ParticlegetPrototype()booleanhandleMessage(com.badlogic.gdx.ai.msg.Telegram msg)voidsetActive(boolean active)Makes the emitter spawn objectsvoidsetBrightness(float brightness)If it can emit light.voidsetParticleDelay(float timeEachSpawn)voidsetParticleSpread(com.badlogic.gdx.math.Vector3 spread)Spread is applied in both directions.voidsetParticleStartMovement(com.badlogic.gdx.math.Vector3 dir)voidsetPrototype(Particle prototype)AbstractEntityspawn(Point point)Add this entity to the map-> let it spawnvoidtoggle()voidupdate(float dt)Updates the logic of the object.-
Methods inherited from class com.bombinggames.wurfelengine.core.gameobjects.AbstractEntity
addComponent, collidesWith, dispose, getCollidingEntities, getCollidingEntities, getComponents, getComponents, getCoord, getCoveredBlocks, getDimensionZ, getHealth, getLightlevelB, getLightlevelG, getLightlevelR, getMass, getName, getPoint, getPosition, getRegisteredEntities, getSpriteCategory, getSpriteId, getSpriteValue, hasPosition, heal, isIndestructible, isInMemoryArea, isMarkedDS, isOnGround, isSavedPersistent, markAsVisitedDS, registerEngineEntities, registerEntity, removeComponent, removeFromMap, requestChunk, setDamageSounds, setDimensionZ, setHealth, setIndestructible, setLightlevel, setMass, setName, setPosition, setPosition, setSavePersistent, setSpriteCategory, setSpriteId, setSpriteValue, setUseRawDelta, shouldBeDisposed, takeDamage, useRawDelta
-
Methods inherited from class com.bombinggames.wurfelengine.core.gameobjects.AbstractGameObject
getColor, getDepth, getPixmap, getRotation, getScaling, getSprite, getSprite, getSpritesheet, getSpritesheetPath, getTextureDiffuse, getTextureNormal, isHidden, loadSheet, render, render, setColor, setCustomSpritesheet, setHidden, setRotation, setScaling, shouldBeRendered, staticDispose, updateSpriteCache
-
-
-
-
Method Detail
-
spawn
public AbstractEntity spawn(Point point)
Description copied from class:AbstractEntityAdd this entity to the map-> let it spawn- Overrides:
spawnin classAbstractEntity- Parameters:
point- the point in the game world where the object is. If it was previously set this is ignored.- Returns:
- returns itself
-
update
public void update(float dt)
Description copied from class:AbstractEntityUpdates the logic of the object.- Overrides:
updatein classAbstractEntity- Parameters:
dt- time since last update in game time
-
toggle
public void toggle()
-
setActive
public void setActive(boolean active)
Makes the emitter spawn objects- Parameters:
active-
-
setPrototype
public void setPrototype(Particle prototype)
- Parameters:
prototype-
-
getPrototype
public Particle getPrototype()
- Returns:
-
setParticleStartMovement
public void setParticleStartMovement(com.badlogic.gdx.math.Vector3 dir)
- Parameters:
dir- the direction and speed where the particles leave, in m/s without unit
-
setParticleSpread
public void setParticleSpread(com.badlogic.gdx.math.Vector3 spread)
Spread is applied in both directions.- Parameters:
spread- the range in which random noise gets aplied, in m/s without unit
-
setParticleDelay
public void setParticleDelay(float timeEachSpawn)
- Parameters:
timeEachSpawn- time in ms
-
setBrightness
public void setBrightness(float brightness)
If it can emit light.- Parameters:
brightness- values > 0 enable the light source. Typicall values 0-100
-
handleMessage
public boolean handleMessage(com.badlogic.gdx.ai.msg.Telegram msg)
-
-