Class EnemyFollowingProjectile

All Implemented Interfaces:
com.badlogic.gdx.utils.Pool.Poolable, com.esotericsoftware.kryo.KryoSerializable
Direct Known Subclasses:
AirProjectile, BasicProjectile, BuffProjectile, EnemyFollowingExplosiveProjectile, VenomProjectile

public abstract class EnemyFollowingProjectile extends Projectile
Обычный снаряд, который долетает до целевого врага
  • Field Details

    • DEFAULT_MAX_ROT_SPEED

      public static final float DEFAULT_MAX_ROT_SPEED
      See Also:
    • DEFAULT_MAX_ROT_SPEED_DYNAMIC

      public static final float DEFAULT_MAX_ROT_SPEED_DYNAMIC
      See Also:
    • start

      public com.badlogic.gdx.math.Vector2 start
    • speed

      public float speed
    • maxRotationSpeed

      public float maxRotationSpeed
    • maxRotationSpeedDynamic

      public float maxRotationSpeedDynamic
    • drawPosition

      public com.badlogic.gdx.math.Vector2 drawPosition
    • drawAngle

      public float drawAngle
  • Method Details

    • write

      public void write(com.esotericsoftware.kryo.Kryo kryo, com.esotericsoftware.kryo.io.Output output)
      Specified by:
      write in interface com.esotericsoftware.kryo.KryoSerializable
      Overrides:
      write in class Projectile
    • read

      public void read(com.esotericsoftware.kryo.Kryo kryo, com.esotericsoftware.kryo.io.Input input)
      Specified by:
      read in interface com.esotericsoftware.kryo.KryoSerializable
      Overrides:
      read in class Projectile
    • getTarget

      public Enemy getTarget()
      Returns:
      null if no target / target is unregistered (no need to check for Enemy.isRegistered())
    • setTarget

      public void setTarget(Enemy target)
    • applyDrawInterpolation

      public void applyDrawInterpolation(float interpolatedTime)
      Specified by:
      applyDrawInterpolation in class Projectile
    • flyOnEnemy

      public void flyOnEnemy(Enemy enemy)
      Description copied from class: Projectile
      Перенаправить снаряд на врага (метод может быть не реализован)
      Overrides:
      flyOnEnemy in class Projectile
    • setUnregistered

      public void setUnregistered()
      Overrides:
      setUnregistered in class Registrable
    • 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 interface com.badlogic.gdx.utils.Pool.Poolable
      Overrides:
      reset in class Projectile
    • getPosition

      public com.badlogic.gdx.math.Vector2 getPosition()
      Overrides:
      getPosition in class Projectile
    • update

      public void update(float deltaTime)
      Specified by:
      update in class Projectile
    • isDone

      public boolean isDone()
      Specified by:
      isDone in class Projectile
      Returns:
      true, если снаряд больше не нужен и может быть убран из системы
    • hasReachedTarget

      public boolean hasReachedTarget()
      Specified by:
      hasReachedTarget in class Projectile