Package com.prineside.tdi2
Class CollidingProjectile
java.lang.Object
com.prineside.tdi2.Registrable
com.prineside.tdi2.Projectile
com.prineside.tdi2.CollidingProjectile
- All Implemented Interfaces:
Pool.Poolable
,KryoSerializable
- Direct Known Subclasses:
BulletWallProjectile
,MultishotProjectile
,SplashProjectile
,SplinterProjectile
-
Nested Class Summary
Nested classes/interfaces inherited from class com.prineside.tdi2.Projectile
Projectile.Factory<T extends Projectile>
-
Field Summary
FieldsModifier and TypeFieldDescriptionfloat
float
static final float
Ray cast won't happen until projectile travels this distance (TILE_SIZE / 4)static final float
float
Fields inherited from class com.prineside.tdi2.Projectile
id, position, type
Fields inherited from class com.prineside.tdi2.Registrable
S
-
Method Summary
Modifier and TypeMethodDescriptionvoid
applyDrawInterpolation
(float interpolatedTime) void
flyOnEnemy
(Enemy enemy) Make projectile fly towards an enemy (some projectile types, such as Laser, do not implement this method)boolean
boolean
isDone()
void
void
reset()
Resets the object for reuse.void
update
(float deltaTime) void
Methods inherited from class com.prineside.tdi2.Projectile
draw, getDamage, getPosition, hit, multiplyDamage, onDone, setDamage, setup, toString
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:
-
RAYCAST_INTERVAL_MIN_SQR
public static final float RAYCAST_INTERVAL_MIN_SQR- See Also:
-
flyTime
public float flyTime -
totalFlyTime
public float totalFlyTime -
drawPosition
-
drawAngle
public float drawAngle
-
-
Method Details
-
write
- Specified by:
write
in interfaceKryoSerializable
- Overrides:
write
in classProjectile
-
read
- Specified by:
read
in interfaceKryoSerializable
- Overrides:
read
in classProjectile
-
applyDrawInterpolation
public void applyDrawInterpolation(float interpolatedTime) - Specified by:
applyDrawInterpolation
in classProjectile
-
flyOnEnemy
Description copied from class:Projectile
Make projectile fly towards an enemy (some projectile types, such as Laser, do not implement this method)- Overrides:
flyOnEnemy
in classProjectile
-
isDone
public boolean isDone()- Specified by:
isDone
in classProjectile
- Returns:
- true if projectile has done its job, no longer needed and can be removed from the system
-
hasReachedTarget
public boolean hasReachedTarget()- Specified by:
hasReachedTarget
in classProjectile
-
update
public void update(float deltaTime) - Specified by:
update
in classProjectile
-
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
- Overrides:
reset
in classProjectile
-