public class Bullet extends AbstractEntity
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 |
---|
Bullet()
You can set a different sprite via
#setGraphicsId(int) . |
Modifier and Type | Method and Description |
---|---|
void |
dispose()
Deletes the object from the map and every other container.
|
int |
getDistance() |
void |
setDamage(byte damage) |
void |
setDirection(com.badlogic.gdx.math.Vector3 dir) |
void |
setExplosive(int ex) |
void |
setImpactSprite(int id)
Set the sprite which get spawned when the bullet hits.
|
void |
setMaxDistance(int maxDistance) |
void |
setParent(MovableEntity parent) |
void |
setSpeed(float speed) |
void |
update(float dt)
Updates the logic of the object.
|
disableShadow, disposeFromMap, enableShadow, getAnimation, getCategory, getDimensionZ, getName, getPosition, getRegisteredEntities, isGettingSaved, isInMemoryArea, isObstacle, isOnGround, isTransparent, registerEngineEntities, registerEntity, setAnimation, setDimensionZ, setHeight, setName, setObstacle, setPosition, setSaveToDisk, shouldBeDisposed, shouldBeDisposedFromMap, spawn, spawned
getAtlasRegion, getColor, getCoreData, getDepth, getDrawCalls, getHealth, getId, getLightlevel, getPixmap, getRotation, getScaling, getSprite, getSpriteId, getSprites, getSpritesheet, getSpritesheetPath, getTextureDiffuse, getTextureNormal, getValue, increaseDrawCalls, isHidden, loadSheet, render, render, render, render, resetDrawCalls, setColor, setCustomSpritesheet, setGraphicsId, setHealth, setHidden, setLightlevel, setRotation, setScaling, setValue, staticDispose
public Bullet()
#setGraphicsId(int)
. It uses the engine default sprite.#setGraphicsId(int)
public void update(float dt)
AbstractEntity
update
in class AbstractEntity
dt
- time since last updatepublic void setDirection(com.badlogic.gdx.math.Vector3 dir)
dir
- public void setSpeed(float speed)
speed
- public void setParent(MovableEntity parent)
parent
- public void setMaxDistance(int maxDistance)
maxDistance
- public void setDamage(byte damage)
damage
- public void setExplosive(int ex)
ex
- public void dispose()
AbstractEntity
dispose
in class AbstractEntity
AbstractEntity.shouldBeDisposed()
,
AbstractEntity.disposeFromMap()
public void setImpactSprite(int id)
id
- if you don't want an impact sprite set id to0.public int getDistance()