Package com.prineside.tdi2
Class Projectile
java.lang.Object
com.prineside.tdi2.Registrable
com.prineside.tdi2.Projectile
- All Implemented Interfaces:
Pool.Poolable
,KryoSerializable
- Direct Known Subclasses:
ChainLightningProjectile
,CollidingProjectile
,EnemyFollowingProjectile
,LaserProjectile
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionint
static final float
Ray cast won't happen until projectile travels this distance (TILE_SIZE / 4)Fields inherited from class com.prineside.tdi2.Registrable
S
-
Method Summary
Modifier and TypeMethodDescriptionabstract void
applyDrawInterpolation
(float interpolatedTime) abstract void
void
flyOnEnemy
(Enemy enemy) Make projectile fly towards an enemy (some projectile types, such as Laser, do not implement this method)float
abstract boolean
void
hit()
Called when the projectile has reached its targetabstract boolean
isDone()
void
multiplyDamage
(float mul) void
onDone()
void
void
reset()
Resets the object for reuse.void
setDamage
(float damage) void
setup()
toString()
abstract void
update
(float delta) void
Methods inherited from class com.prineside.tdi2.Registrable
isRegistered, setRegistered, setUnregistered
-
Field Details
-
RAYCAST_INTERVAL_MIN
public static final float RAYCAST_INTERVAL_MINRay cast won't happen until projectile travels this distance (TILE_SIZE / 4)- See Also:
-
type
-
id
public int id -
position
-
-
Method Details
-
write
- Specified by:
write
in interfaceKryoSerializable
- Overrides:
write
in classRegistrable
-
read
- Specified by:
read
in interfaceKryoSerializable
- Overrides:
read
in classRegistrable
-
setup
public void setup() -
getPosition
-
getDamage
public float getDamage() -
setDamage
public void setDamage(float damage) -
multiplyDamage
public void multiplyDamage(float mul) -
reset
public void reset()Description copied from interface:com.badlogic.gdx.utils.Pool.Poolable
Resets the object for reuse. Object references should be nulled and fields may be set to default values.- Specified by:
reset
in interfacePool.Poolable
-
hit
public void hit()Called when the projectile has reached its target -
isDone
public abstract boolean isDone()- Returns:
- true if projectile has done its job, no longer needed and can be removed from the system
-
hasReachedTarget
public abstract boolean hasReachedTarget() -
onDone
public void onDone() -
flyOnEnemy
Make projectile fly towards an enemy (some projectile types, such as Laser, do not implement this method) -
applyDrawInterpolation
public abstract void applyDrawInterpolation(float interpolatedTime) -
update
public abstract void update(float delta) -
draw
-
toString
-