Package com.prineside.tdi2
Class CollidingProjectile
java.lang.Object
com.prineside.tdi2.Registrable
com.prineside.tdi2.Projectile
com.prineside.tdi2.CollidingProjectile
- All Implemented Interfaces:
com.badlogic.gdx.utils.Pool.Poolable
,com.esotericsoftware.kryo.KryoSerializable
- Direct Known Subclasses:
BulletWallProjectile
,MultishotProjectile
,SplashProjectile
,SplinterProjectile
Позиция меняется благодаря preRender(), колизии проверяются в scheduledUpdate()
-
Nested Class Summary
Nested classes/interfaces inherited from class com.prineside.tdi2.Projectile
Projectile.Factory<T extends Projectile>
-
Field Summary
FieldsModifier and TypeFieldDescriptionfloat
com.badlogic.gdx.math.Vector2
float
float
protected com.badlogic.gdx.math.Vector2
protected float
Fields inherited from class com.prineside.tdi2.Projectile
damage, id, position, RAYCAST_INTERVAL_MIN, type
Fields inherited from class com.prineside.tdi2.Registrable
S
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
applyDrawInterpolation
(float interpolatedTime) protected abstract void
void
flyOnEnemy
(Enemy enemy) Перенаправить снаряд на врага (метод может быть не реализован)protected float
getAngle()
protected float
boolean
boolean
isDone()
void
read
(com.esotericsoftware.kryo.Kryo kryo, com.esotericsoftware.kryo.io.Input input) void
reset()
Resets the object for reuse.protected void
setup
(com.badlogic.gdx.math.Vector2 start, float speed, com.badlogic.gdx.math.Vector2 end) protected void
setup
(com.badlogic.gdx.math.Vector2 start, com.badlogic.gdx.math.Vector2 velocity, float flyTime) protected void
setVelocity
(float x, float y) protected void
setVelocity
(com.badlogic.gdx.math.Vector2 velocity) void
update
(float deltaTime) void
write
(com.esotericsoftware.kryo.Kryo kryo, com.esotericsoftware.kryo.io.Output output) 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
-
flyTime
public float flyTime -
totalFlyTime
public float totalFlyTime -
velocityNormalized
protected com.badlogic.gdx.math.Vector2 velocityNormalized -
velocityScalar
protected float velocityScalar -
drawPosition
public com.badlogic.gdx.math.Vector2 drawPosition -
drawAngle
public float drawAngle
-
-
Constructor Details
-
CollidingProjectile
-
-
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
protected void setup(com.badlogic.gdx.math.Vector2 start, float speed, com.badlogic.gdx.math.Vector2 end) -
setup
protected void setup(com.badlogic.gdx.math.Vector2 start, com.badlogic.gdx.math.Vector2 velocity, float flyTime) -
applyDrawInterpolation
public void applyDrawInterpolation(float interpolatedTime) - Specified by:
applyDrawInterpolation
in classProjectile
-
flyOnEnemy
Description copied from class:Projectile
Перенаправить снаряд на врага (метод может быть не реализован)- Overrides:
flyOnEnemy
in classProjectile
-
setVelocity
protected void setVelocity(com.badlogic.gdx.math.Vector2 velocity) -
setVelocity
protected void setVelocity(float x, float y) -
getFlyTimeLeft
protected float getFlyTimeLeft() -
getAngle
protected float getAngle() -
isDone
public boolean isDone()- Specified by:
isDone
in classProjectile
- Returns:
- true, если снаряд больше не нужен и может быть убран из системы
-
hasReachedTarget
public boolean hasReachedTarget()- Specified by:
hasReachedTarget
in classProjectile
-
update
public void update(float deltaTime) - Specified by:
update
in classProjectile
-
enemyHit
-
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
-