v0.8.0: corrected various rare errors with evil eye sprites
This commit is contained in:
parent
2138ad24ec
commit
9e65b4b634
|
@ -50,11 +50,6 @@ public class EyeSprite extends MobSprite {
|
||||||
|
|
||||||
charging = new Animation( 12, true);
|
charging = new Animation( 12, true);
|
||||||
charging.frames( frames, 3, 4 );
|
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 = new Animation( 12, true );
|
||||||
run.frames( frames, 5, 6 );
|
run.frames( frames, 5, 6 );
|
||||||
|
@ -72,14 +67,38 @@ public class EyeSprite extends MobSprite {
|
||||||
@Override
|
@Override
|
||||||
public void link(Char ch) {
|
public void link(Char ch) {
|
||||||
super.link(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);
|
if (((Eye)ch).beamCharged) play(charging);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void update() {
|
public void update() {
|
||||||
super.update();
|
super.update();
|
||||||
chargeParticles.pos(center());
|
if (chargeParticles != null){
|
||||||
chargeParticles.visible = visible;
|
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 ){
|
public void charge( int pos ){
|
||||||
|
@ -89,7 +108,7 @@ public class EyeSprite extends MobSprite {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void play(Animation anim) {
|
public void play(Animation anim) {
|
||||||
chargeParticles.on = anim == charging;
|
if (chargeParticles != null) chargeParticles.on = anim == charging;
|
||||||
super.play(anim);
|
super.play(anim);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user