Package com.prineside.tdi2
Class Projectile
java.lang.Object
com.prineside.tdi2.Registrable
com.prineside.tdi2.Projectile
- All Implemented Interfaces:
com.badlogic.gdx.utils.Pool.Poolable
,com.esotericsoftware.kryo.KryoSerializable
- Direct Known Subclasses:
ChainLightningProjectile
,CollidingProjectile
,EnemyFollowingProjectile
,LaserProjectile
public abstract class Projectile
extends Registrable
implements com.badlogic.gdx.utils.Pool.Poolable
-
Nested Class Summary
-
Field Summary
Modifier and TypeFieldDescriptionint
com.badlogic.gdx.math.Vector2
static final float
Fields inherited from class com.prineside.tdi2.Registrable
S
-
Method Summary
Modifier and TypeMethodDescriptionabstract void
applyDrawInterpolation
(float interpolatedTime) abstract void
draw
(com.badlogic.gdx.graphics.g2d.Batch batch, float delta) void
flyOnEnemy
(Enemy enemy) Перенаправить снаряд на врага (метод может быть не реализован)float
com.badlogic.gdx.math.Vector2
abstract boolean
void
hit()
Вызывается, когда снаряд долетел до целиabstract boolean
isDone()
void
multiplyDamage
(float mul) void
onDone()
void
read
(com.esotericsoftware.kryo.Kryo kryo, com.esotericsoftware.kryo.io.Input input) void
reset()
Resets the object for reuse.void
setDamage
(float damage) void
setup()
toString()
abstract void
update
(float delta) void
write
(com.esotericsoftware.kryo.Kryo kryo, com.esotericsoftware.kryo.io.Output output) Methods inherited from class com.prineside.tdi2.Registrable
isRegistered, setRegistered, setUnregistered
-
Field Details
-
RAYCAST_INTERVAL_MIN
public static final float RAYCAST_INTERVAL_MIN- See Also:
-
type
-
id
public int id -
position
public com.badlogic.gdx.math.Vector2 position
-
-
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 classRegistrable
-
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 classRegistrable
-
setup
public void setup() -
getPosition
public com.badlogic.gdx.math.Vector2 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 interfacecom.badlogic.gdx.utils.Pool.Poolable
-
hit
public void hit()Вызывается, когда снаряд долетел до цели -
isDone
public abstract boolean isDone()- Returns:
- true, если снаряд больше не нужен и может быть убран из системы
-
hasReachedTarget
public abstract boolean hasReachedTarget() -
onDone
public void onDone() -
flyOnEnemy
Перенаправить снаряд на врага (метод может быть не реализован) -
applyDrawInterpolation
public abstract void applyDrawInterpolation(float interpolatedTime) -
update
public abstract void update(float delta) -
draw
public abstract void draw(com.badlogic.gdx.graphics.g2d.Batch batch, float delta) -
toString
-