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 TypeFieldDescriptionfloatcom.badlogic.gdx.math.Vector2floatfloatprotected com.badlogic.gdx.math.Vector2protected floatFields inherited from class com.prineside.tdi2.Projectile
damage, id, position, RAYCAST_INTERVAL_MIN, typeFields inherited from class com.prineside.tdi2.Registrable
S - 
Constructor Summary
Constructors - 
Method Summary
Modifier and TypeMethodDescriptionvoidapplyDrawInterpolation(float interpolatedTime) protected abstract voidvoidflyOnEnemy(Enemy enemy) Перенаправить снаряд на врага (метод может быть не реализован)protected floatgetAngle()protected floatbooleanbooleanisDone()voidread(com.esotericsoftware.kryo.Kryo kryo, com.esotericsoftware.kryo.io.Input input) voidreset()Resets the object for reuse.protected voidsetup(com.badlogic.gdx.math.Vector2 start, float speed, com.badlogic.gdx.math.Vector2 end) protected voidsetup(com.badlogic.gdx.math.Vector2 start, com.badlogic.gdx.math.Vector2 velocity, float flyTime) protected voidsetVelocity(float x, float y) protected voidsetVelocity(com.badlogic.gdx.math.Vector2 velocity) voidupdate(float deltaTime) voidwrite(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, toStringMethods 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:
 writein interfacecom.esotericsoftware.kryo.KryoSerializable- Overrides:
 writein classProjectile
 - 
read
public void read(com.esotericsoftware.kryo.Kryo kryo, com.esotericsoftware.kryo.io.Input input) - Specified by:
 readin interfacecom.esotericsoftware.kryo.KryoSerializable- Overrides:
 readin 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:
 applyDrawInterpolationin classProjectile
 - 
flyOnEnemy
Description copied from class:ProjectileПеренаправить снаряд на врага (метод может быть не реализован)- Overrides:
 flyOnEnemyin 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:
 isDonein classProjectile- Returns:
 - true, если снаряд больше не нужен и может быть убран из системы
 
 - 
hasReachedTarget
public boolean hasReachedTarget()- Specified by:
 hasReachedTargetin classProjectile
 - 
update
public void update(float deltaTime) - Specified by:
 updatein classProjectile
 - 
enemyHit
 - 
reset
public void reset()Description copied from interface:com.badlogic.gdx.utils.Pool.PoolableResets the object for reuse. Object references should be nulled and fields may be set to default values.- Specified by:
 resetin interfacecom.badlogic.gdx.utils.Pool.Poolable- Overrides:
 resetin classProjectile
 
 -