v0.8.0: improved animations for DM-100s

This commit is contained in:
Evan Debenham 2020-03-11 20:44:02 -04:00
parent 8ecb5d0fe5
commit 6441f2fd5e
2 changed files with 15 additions and 5 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.2 KiB

After

Width:  |  Height:  |  Size: 7.8 KiB

View File

@ -29,8 +29,9 @@ import com.shatteredpixel.shatteredpixeldungeon.effects.Lightning;
import com.shatteredpixel.shatteredpixeldungeon.effects.Speck; import com.shatteredpixel.shatteredpixeldungeon.effects.Speck;
import com.watabou.noosa.TextureFilm; import com.watabou.noosa.TextureFilm;
import com.watabou.noosa.audio.Sample; import com.watabou.noosa.audio.Sample;
import com.watabou.utils.PointF;
//TODO sprite still needs work //TODO sprite still needs some color tweaking?
public class DM100Sprite extends MobSprite { public class DM100Sprite extends MobSprite {
public DM100Sprite () { public DM100Sprite () {
@ -38,7 +39,7 @@ public class DM100Sprite extends MobSprite {
texture( Assets.DM100 ); texture( Assets.DM100 );
TextureFilm frames = new TextureFilm( texture, 14, 14 ); TextureFilm frames = new TextureFilm( texture, 16, 14 );
idle = new Animation( 1, true ); idle = new Animation( 1, true );
idle.frames( frames, 0, 1 ); idle.frames( frames, 0, 1 );
@ -62,10 +63,19 @@ public class DM100Sprite extends MobSprite {
Char enemy = Actor.findChar(pos); Char enemy = Actor.findChar(pos);
if (enemy != null) { //shoot lightning from eye, not sprite center.
parent.add(new Lightning(center(), enemy.sprite.destinationCenter(), (DM100) ch)); PointF origin = center();
if (flipHorizontal){
origin.y -= 6*scale.y;
origin.x -= 1*scale.x;
} else { } else {
parent.add(new Lightning(center(), pos, (DM100) ch)); origin.y -= 8*scale.y;
origin.x += 1*scale.x;
}
if (enemy != null) {
parent.add(new Lightning(origin, enemy.sprite.destinationCenter(), (DM100) ch));
} else {
parent.add(new Lightning(origin, pos, (DM100) ch));
} }
Sample.INSTANCE.play( Assets.SND_LIGHTNING ); Sample.INSTANCE.play( Assets.SND_LIGHTNING );