public class Bullet extends AbstractEntity
GAME_DIAGLENGTH, GAME_DIAGLENGTH2, GAME_EDGELENGTH, GAME_EDGELENGTH2, OBJECTTYPESNUM, SCREEN_DEPTH, SCREEN_DEPTH2, SCREEN_DEPTH4, SCREEN_HEIGHT, SCREEN_HEIGHT2, SCREEN_HEIGHT4, SCREEN_WIDTH, SCREEN_WIDTH2, SCREEN_WIDTH4, VALUESNUM
Constructor and Description |
---|
Bullet(int id) |
Modifier and Type | Method and Description |
---|---|
void |
dispose()
Deletes the object from the map.
|
int |
getDistance() |
static void |
init() |
void |
setDamage(int 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 delta)
Updates the logic of the object.
|
getCategory, getDimensionZ, getName, getPosition, isOnGround, render, save, setDimensionZ, setHeight, setPosition, shouldBeDisposed, spawn, spawned
getDrawCalls, getHealth, getId, getLightlevel, getPixmap, getRotation, getSprite, getSpriteId, getSprites, getSpritesheet, getValue, increaseDrawCalls, isHidden, isObstacle, isTransparent, loadSheet, render, render, render, render, render, render, render, resetDrawCalls, setGraphicsId, setHealth, setHidden, setLightlevel, setObstacle, setRotation, setTransparent, setValue, staticDispose, updateStaticUpdates
public static void init()
public void update(float delta)
AbstractEntity
update
in class AbstractEntity
delta
- 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(int damage)
damage
- public void setExplosive(int ex)
ex
- public void dispose()
AbstractEntity
dispose
in class AbstractEntity
AbstractEntity.shouldBeDisposed()
public void setImpactSprite(int id)
id
- if you don't want an impact sprite set id to0.public int getDistance()