Package com.prineside.tdi2.projectiles
Class LaserProjectile
java.lang.Object
com.prineside.tdi2.Registrable
com.prineside.tdi2.Projectile
com.prineside.tdi2.projectiles.LaserProjectile
- All Implemented Interfaces:
Pool.Poolable
,KryoSerializable
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from class com.prineside.tdi2.Projectile
Projectile.Factory<T extends Projectile>
-
Field Summary
FieldsFields 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
float
float
getEndX()
float
getEndY()
float
float
void
handleCollisions
(float deltaTime) boolean
boolean
isDone()
void
void
reset()
Resets the object for reuse.void
setDuration
(float duration) void
setEndPos
(float x, float y) void
setStartPos
(float x, float y) void
Remove the reference to the game state and mark this object as not registered.void
setup
(Tower tower, float duration, float damage, float startX, float startY, float endX, float endY, int penetrationCount) void
stop()
void
update
(float delta) void
Methods inherited from class com.prineside.tdi2.Projectile
flyOnEnemy, getDamage, getPosition, hit, multiplyDamage, onDone, setDamage, setup, toString
Methods inherited from class com.prineside.tdi2.Registrable
isRegistered, setRegistered
-
Field Details
-
penetrationCount
public int penetrationCount
-
-
Method Details
-
write
- Specified by:
write
in interfaceKryoSerializable
- Overrides:
write
in classProjectile
-
read
- Specified by:
read
in interfaceKryoSerializable
- Overrides:
read
in classProjectile
-
setup
public void setup(Tower tower, float duration, float damage, float startX, float startY, float endX, float endY, int penetrationCount) -
getStartX
public float getStartX() -
getStartY
public float getStartY() -
getEndX
public float getEndX() -
getEndY
public float getEndY() -
setUnregistered
public void setUnregistered()Description copied from class:Registrable
Remove the reference to the game state and mark this object as not registered.- Overrides:
setUnregistered
in classRegistrable
-
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
-
stop
public void stop() -
handleCollisions
public void handleCollisions(float deltaTime) -
setStartPos
public void setStartPos(float x, float y) -
setEndPos
public void setEndPos(float x, float y) -
getDuration
public float getDuration() -
setDuration
public void setDuration(float duration) -
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
-
applyDrawInterpolation
public void applyDrawInterpolation(float interpolatedTime) - Specified by:
applyDrawInterpolation
in classProjectile
-
update
public void update(float delta) - Specified by:
update
in classProjectile
-
draw
- Specified by:
draw
in classProjectile
-