diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/effects/Speck.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/effects/Speck.java index cd3118d0c..abf20ac40 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/effects/Speck.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/effects/Speck.java @@ -243,7 +243,7 @@ public class Speck extends Image { scale.set( Random.Float( 1, 2 ) ); speed.set( 0, 64 ); lifespan = 0.2f; - y -= speed.y * lifespan; + this.y -= speed.y * lifespan; break; case NOTE: diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/effects/particles/EarthParticle.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/effects/particles/EarthParticle.java index f6c652bf0..bd4a48140 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/effects/particles/EarthParticle.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/effects/particles/EarthParticle.java @@ -35,14 +35,19 @@ public class EarthParticle extends PixelParticle { ((EarthParticle)emitter.recycle( EarthParticle.class )).reset( x, y ); } }; - + + public static final Emitter.Factory FALLING = new Factory() { + @Override + public void emit( Emitter emitter, int index, float x, float y ) { + ((EarthParticle)emitter.recycle( EarthParticle.class )).resetFalling( x, y ); + } + }; + public EarthParticle() { super(); color( ColorMath.random( 0x444444, 0x777766 ) ); angle = Random.Float( -30, 30 ); - - lifespan = 0.5f; } public void reset( float x, float y ) { @@ -51,7 +56,18 @@ public class EarthParticle extends PixelParticle { this.x = x; this.y = y; - left = lifespan; + left = lifespan = 0.5f; + size = 16; + } + + public void resetFalling( float x, float y ) { + reset(x, y); + + left = lifespan = 1f; + size = 8; + + acc.y = 15; + speed.y = 0; } @Override @@ -59,6 +75,6 @@ public class EarthParticle extends PixelParticle { super.update(); float p = left / lifespan; - size( (p < 0.5f ? p : 1 - p) * 16 ); + size( (p < 0.5f ? p : 1 - p) * size ); } } \ No newline at end of file