V0.2.1 : Added particle effects to Goo

This commit is contained in:
Evan Debenham
2014-10-02 00:31:44 -04:00
parent 13cf972982
commit 346f5b4e88
4 changed files with 170 additions and 37 deletions
@@ -0,0 +1,25 @@
package com.shatteredpixel.shatteredpixeldungeon.effects.particles;
import com.watabou.noosa.particles.Emitter;
/**
* Created by Evan on 30/09/2014.
*/
public class GooWarnParticle extends WindParticle {
public static final Emitter.Factory FACTORY = new Emitter.Factory() {
@Override
public void emit( Emitter emitter, int index, float x, float y ) {
((GooWarnParticle)emitter.recycle( GooWarnParticle.class )).reset( x, y );
}
};
@Override
public void update() {
super.update();
float p = left / lifespan;
color( 0x000000 );
am = (p < 0.5f ? p : 1 - p) * size;
}
}
@@ -38,8 +38,7 @@ public class WindParticle extends PixelParticle {
private static float angle = Random.Float( PointF.PI * 2 );
private static PointF speed = new PointF().polar( angle, 5 );
private float size;
public WindParticle() {
super();