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 TypeFieldDescriptionintstatic final floatRay 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 voidapplyDrawInterpolation(float interpolatedTime) abstract voidvoidflyOnEnemy(Enemy enemy) Make projectile fly towards an enemy (some projectile types, such as Laser, do not implement this method)floatabstract booleanvoidhit()Called when the projectile has reached its targetabstract booleanisDone()voidmultiplyDamage(float mul) voidonDone()voidvoidreset()Resets the object for reuse.voidsetDamage(float damage) voidsetup()toString()abstract voidupdate(float delta) voidMethods 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:
 writein interfaceKryoSerializable- Overrides:
 writein classRegistrable
 - 
read
- Specified by:
 readin interfaceKryoSerializable- Overrides:
 readin 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.PoolableResets the object for reuse. Object references should be nulled and fields may be set to default values.- Specified by:
 resetin 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
 
 -