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:
com.badlogic.gdx.utils.Pool.Poolable
,com.esotericsoftware.kryo.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
damage, id, position, RAYCAST_INTERVAL_MIN, type
Fields inherited from class com.prineside.tdi2.Registrable
S
-
Method Summary
Modifier and TypeMethodDescriptionvoid
applyDrawInterpolation
(float interpolatedTime) void
draw
(com.badlogic.gdx.graphics.g2d.Batch batch, float delta) float
getEndX()
float
getEndY()
float
float
void
handleCollisions
(float deltaTime) boolean
boolean
isDone()
void
read
(com.esotericsoftware.kryo.Kryo kryo, com.esotericsoftware.kryo.io.Input input) void
reset()
Resets the object for reuse.void
setEndPos
(float x, float y) void
setStartPos
(float x, float y) void
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
write
(com.esotericsoftware.kryo.Kryo kryo, com.esotericsoftware.kryo.io.Output output) 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
public void write(com.esotericsoftware.kryo.Kryo kryo, com.esotericsoftware.kryo.io.Output output) - Specified by:
write
in interfacecom.esotericsoftware.kryo.KryoSerializable
- Overrides:
write
in classProjectile
-
read
public void read(com.esotericsoftware.kryo.Kryo kryo, com.esotericsoftware.kryo.io.Input input) - Specified by:
read
in interfacecom.esotericsoftware.kryo.KryoSerializable
- 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()- 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 interfacecom.badlogic.gdx.utils.Pool.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) -
isDone
public boolean isDone()- Specified by:
isDone
in classProjectile
- Returns:
- true, если снаряд больше не нужен и может быть убран из системы
-
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
public void draw(com.badlogic.gdx.graphics.g2d.Batch batch, float delta) - Specified by:
draw
in classProjectile
-