public class Bullet extends AbstractEntity
NAMELIST
GAME_DIAGLENGTH, GAME_DIAGLENGTH2, GAME_EDGELENGTH, OBJECTTYPESCOUNT, SCREEN_DEPTH, SCREEN_DEPTH2, SCREEN_DEPTH4, SCREEN_HEIGHT, SCREEN_HEIGHT2, SCREEN_HEIGHT4, SCREEN_WIDTH, SCREEN_WIDTH2, SCREEN_WIDTH4, VALUESCOUNT
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(AbstractCharacter parent) |
void |
setSpeed(float speed) |
void |
update(float delta)
Updates the logic of the object.
|
exist, getCategory, getDepth, getName, getPos, onGround, setHeight, setPos, shouldBeDisposed
getDimensionZ, getDrawCalls, getId, getLightlevel, getPixmap, getSprite, getSprites, getSpritesheet, getValue, increaseDrawCalls, isClipped, isHidden, isObstacle, isTransparent, loadSheet, prepareColor, render, render, render, render, render, render, render, resetDrawCalls, setClipped, setDimensionZ, setHidden, setLightlevel, setObstacle, setTransparent, setValue, staticDispose, updateStaticUpdates
public Bullet(int id, Point point)
id
- point
- public static void init()
public void update(float delta)
AbstractGameObject
update
in class AbstractGameObject
delta
- time since last updatepublic void setDirection(com.badlogic.gdx.math.Vector3 dir)
dir
- public void setSpeed(float speed)
speed
- public void setParent(AbstractCharacter 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
public void setImpactSprite(int id)
id
- if you don't want an impact sprite set id to0.public int getDistance()