Class CollidingProjectile

All Implemented Interfaces:
com.badlogic.gdx.utils.Pool.Poolable, com.esotericsoftware.kryo.KryoSerializable
Direct Known Subclasses:
BulletWallProjectile, MultishotProjectile, SplashProjectile, SplinterProjectile

public abstract class CollidingProjectile extends Projectile
Позиция меняется благодаря preRender(), колизии проверяются в scheduledUpdate()
  • 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

      protected CollidingProjectile(ProjectileType type)
  • 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
    • 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 class Projectile
    • flyOnEnemy

      public void flyOnEnemy(Enemy enemy)
      Description copied from class: Projectile
      Перенаправить снаряд на врага (метод может быть не реализован)
      Overrides:
      flyOnEnemy in class Projectile
    • 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 class Projectile
      Returns:
      true, если снаряд больше не нужен и может быть убран из системы
    • hasReachedTarget

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

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

      protected abstract void enemyHit(Enemy enemy)
    • 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