v0.8.0: corrected various rare errors with evil eye sprites
This commit is contained in:
parent
2138ad24ec
commit
9e65b4b634
|
@ -51,11 +51,6 @@ public class EyeSprite extends MobSprite {
|
|||
charging = new Animation( 12, true);
|
||||
charging.frames( frames, 3, 4 );
|
||||
|
||||
chargeParticles = centerEmitter();
|
||||
chargeParticles.autoKill = false;
|
||||
chargeParticles.pour(MagicMissile.MagicParticle.ATTRACTING, 0.05f);
|
||||
chargeParticles.on = false;
|
||||
|
||||
run = new Animation( 12, true );
|
||||
run.frames( frames, 5, 6 );
|
||||
|
||||
|
@ -72,15 +67,39 @@ public class EyeSprite extends MobSprite {
|
|||
@Override
|
||||
public void link(Char ch) {
|
||||
super.link(ch);
|
||||
|
||||
chargeParticles = centerEmitter();
|
||||
chargeParticles.autoKill = false;
|
||||
chargeParticles.pour(MagicMissile.MagicParticle.ATTRACTING, 0.05f);
|
||||
chargeParticles.on = false;
|
||||
|
||||
if (((Eye)ch).beamCharged) play(charging);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void update() {
|
||||
super.update();
|
||||
chargeParticles.pos(center());
|
||||
if (chargeParticles != null){
|
||||
chargeParticles.pos( center() );
|
||||
chargeParticles.visible = visible;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void die() {
|
||||
super.die();
|
||||
if (chargeParticles != null){
|
||||
chargeParticles.on = false;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void kill() {
|
||||
super.kill();
|
||||
if (chargeParticles != null){
|
||||
chargeParticles.killAndErase();
|
||||
}
|
||||
}
|
||||
|
||||
public void charge( int pos ){
|
||||
turnTo(ch.pos, pos);
|
||||
|
@ -89,7 +108,7 @@ public class EyeSprite extends MobSprite {
|
|||
|
||||
@Override
|
||||
public void play(Animation anim) {
|
||||
chargeParticles.on = anim == charging;
|
||||
if (chargeParticles != null) chargeParticles.on = anim == charging;
|
||||
super.play(anim);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user