com.watabou.noosa.particles.Emitter Java Examples

The following examples show how to use com.watabou.noosa.particles.Emitter. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: BossHealthBar.java    From shattered-pixel-dungeon-gdx with GNU General Public License v3.0 6 votes vote down vote up
@Override
protected void createChildren() {
	bar = new Image(asset, 0, 0, 64, 16);
	add(bar);

	width = bar.width;
	height = bar.height;

	hp = new Image(asset, 15, 19, 47, 4);
	add(hp);

	skull = new Image(asset, 5, 18, 6, 6);
	add(skull);

	blood = new Emitter();
	blood.pos(skull);
	blood.pour(BloodParticle.FACTORY, 0.3f);
	blood.autoKill = false;
	blood.on = false;
	add( blood );
}
 
Example #2
Source File: ItemSlot.java    From remixed-dungeon with GNU General Public License v3.0 6 votes vote down vote up
@Override
protected void createChildren() {

    super.createChildren();

    icon = new ItemSprite();
    add(icon);

    emitter = new Emitter();
    add(emitter);

    topLeft = new BitmapText(PixelScene.font1x);
    topLeft.setScale(0.8f, 0.8f);
    add(topLeft);

    topRight = new BitmapText(PixelScene.font1x);
    topRight.setScale(0.8f, 0.8f);
    add(topRight);

    bottomRight = new BitmapText(PixelScene.font1x);
    bottomRight.setScale(0.8f, 0.8f);
    add(bottomRight);
}
 
Example #3
Source File: StartScene.java    From remixed-dungeon with GNU General Public License v3.0 5 votes vote down vote up
@Override
protected void createChildren() {

    super.createChildren();

    avatar = new Image(Assets.AVATARS);
    add(avatar);

    name = PixelScene.createText(GuiProperties.titleFontSize());
    add(name);

    emitter = new Emitter();
    add(emitter);
}
 
Example #4
Source File: MagesStaff.java    From shattered-pixel-dungeon-gdx with GNU General Public License v3.0 5 votes vote down vote up
@Override
//reimplementing this is needed as instance creation of new staff particles must be within this class.
public void emit( Emitter emitter, int index, float x, float y ) {
	StaffParticle c = (StaffParticle)emitter.getFirstAvailable(StaffParticle.class);
	if (c == null) {
		c = new StaffParticle();
		emitter.add(c);
	}
	c.reset(x, y);
}
 
Example #5
Source File: Splash.java    From shattered-pixel-dungeon with GNU General Public License v3.0 5 votes vote down vote up
@Override
public void emit( Emitter emitter, int index, float x, float y ) {
	PixelParticle p = (PixelParticle)emitter.recycle( PixelParticle.Shrinking.class );
	
	p.reset( x, y, color, 4, Random.Float( 0.5f, 1.0f ) );
	p.speed.polar( Random.Float( dir - cone / 2, dir + cone / 2 ), Random.Float( 40, 80 ) );
	p.acc.set( 0, +100 );
}
 
Example #6
Source File: LotusSprite.java    From shattered-pixel-dungeon with GNU General Public License v3.0 5 votes vote down vote up
@Override
public void die() {
	super.die();

	if (grassVfx != null){
		for (Emitter e : grassVfx){
			e.on = false;
		}
		grassVfx = null;
	}
}
 
Example #7
Source File: Spark.java    From YetAnotherPixelDungeon with GNU General Public License v3.0 5 votes vote down vote up
public static void at( PointF p, final int color, int n ) {
	
	if (n <= 0) {
		return;
	}
	
	Emitter emitter = GameScene.emitter();
	emitter.pos( p );
	
	FACTORY.color = color;
	FACTORY.dir = -3.1415926f / 2;
	FACTORY.cone = 3.1415926f;
	emitter.burst( FACTORY, n );
}
 
Example #8
Source File: Splash.java    From unleashed-pixel-dungeon with GNU General Public License v3.0 5 votes vote down vote up
public static void at( PointF p, final int color, int n ) {
	
	if (n <= 0) {
		return;
	}
	
	Emitter emitter = GameScene.emitter();
	emitter.pos( p );
	
	FACTORY.color = color;
	FACTORY.dir = -3.1415926f / 2;
	FACTORY.cone = 3.1415926f;
	emitter.burst( FACTORY, n );
}
 
Example #9
Source File: EarthParticle.java    From shattered-pixel-dungeon-gdx with GNU General Public License v3.0 4 votes vote down vote up
@Override
public void emit( Emitter emitter, int index, float x, float y ) {
	((EarthParticle)emitter.recycle( EarthParticle.class )).reset( x,  y );
}
 
Example #10
Source File: PurpleParticle.java    From YetAnotherPixelDungeon with GNU General Public License v3.0 4 votes vote down vote up
@Override
public void emit( Emitter emitter, int index, float x, float y ) {
    ((PurpleParticle)emitter.recycle( PurpleParticle.class )).resetBurst( x, y );
}
 
Example #11
Source File: MagicMissile.java    From shattered-pixel-dungeon-gdx with GNU General Public License v3.0 4 votes vote down vote up
@Override
public void emit( Emitter emitter, int index, float x, float y ) {
	((MagicParticle)emitter.recycle( MagicParticle.class )).reset( x, y );
}
 
Example #12
Source File: MagicMissile.java    From shattered-pixel-dungeon with GNU General Public License v3.0 4 votes vote down vote up
@Override
public void emit( Emitter emitter, int index, float x, float y ) {
	((ShamanParticle)emitter.recycle( ShamanParticle.class ))
			.reset( x, y, ColorMath.random(0xBB33FF, 0x5E1A80) );
}
 
Example #13
Source File: ElementalSprite.java    From shattered-pixel-dungeon with GNU General Public License v3.0 4 votes vote down vote up
@Override
protected Emitter createEmitter() {
	Emitter emitter = emitter();
	emitter.pour( SparkParticle.STATIC, 0.06f );
	return emitter;
}
 
Example #14
Source File: BloodParticle.java    From shattered-pixel-dungeon-gdx with GNU General Public License v3.0 4 votes vote down vote up
@Override
public void emit( Emitter emitter, int index, float x, float y ) {
	((BloodParticle)emitter.recycle( BloodParticle.class )).resetBurst( x, y );
}
 
Example #15
Source File: MagicMissile.java    From unleashed-pixel-dungeon with GNU General Public License v3.0 4 votes vote down vote up
@Override
public void emit( Emitter emitter, int index, float x, float y ) {
	((EarthParticle)emitter.recycle( EarthParticle.class )).reset( x, y );
}
 
Example #16
Source File: MagicMissile.java    From unleashed-pixel-dungeon with GNU General Public License v3.0 4 votes vote down vote up
@Override
public void emit( Emitter emitter, int index, float x, float y ) {
	((WhiteParticle)emitter.recycle( WhiteParticle.class )).reset( x, y );
}
 
Example #17
Source File: Torch.java    From remixed-dungeon with GNU General Public License v3.0 4 votes vote down vote up
@Override
public void execute(@NotNull Char chr, @NotNull String action ) {
	
	if (action.equals(AC_LIGHT)) {
		
		chr.spend( TIME_TO_LIGHT );
		chr.busy();
		
		chr.getSprite().operate( chr.getPos() );
		
		detach( chr.getBelongings().backpack );
		Buff.affect(chr, Light.class, Light.DURATION );
		
		Emitter emitter = chr.getSprite().centerEmitter();
		emitter.start( FlameParticle.FACTORY, 0.2f, 3 );
		
	} else {
		
		super.execute(chr, action );
		
	}
}
 
Example #18
Source File: PoisonParticle.java    From shattered-pixel-dungeon with GNU General Public License v3.0 4 votes vote down vote up
@Override
public void emit( Emitter emitter, int index, float x, float y ) {
	((PoisonParticle)emitter.recycle( PoisonParticle.class )).resetSplash( x, y );
}
 
Example #19
Source File: CityLevel.java    From shattered-pixel-dungeon with GNU General Public License v3.0 4 votes vote down vote up
@Override
public void emit( Emitter emitter, int index, float x, float y ) {
	SmokeParticle p = (SmokeParticle)emitter.recycle( SmokeParticle.class );
	p.reset( x, y );
}
 
Example #20
Source File: SnowParticle.java    From YetAnotherPixelDungeon with GNU General Public License v3.0 4 votes vote down vote up
@Override
public void emit( Emitter emitter, int index, float x, float y ) {
	((SnowParticle)emitter.recycle( SnowParticle.class )).reset( x, y );
}
 
Example #21
Source File: BloodParticle.java    From YetAnotherPixelDungeon with GNU General Public License v3.0 4 votes vote down vote up
@Override
public void emit( Emitter emitter, int index, float x, float y ) {
	((BloodParticle)emitter.recycle( BloodParticle.class )).reset( x, y );
}
 
Example #22
Source File: BloodParticle.java    From pixel-dungeon with GNU General Public License v3.0 4 votes vote down vote up
@Override
public void emit( Emitter emitter, int index, float x, float y ) {
	((BloodParticle)emitter.recycle( BloodParticle.class )).reset( x, y );
}
 
Example #23
Source File: ShadowParticle.java    From YetAnotherPixelDungeon with GNU General Public License v3.0 4 votes vote down vote up
@Override
public void emit( Emitter emitter, int index, float x, float y ) {
    ((ShadowParticle)emitter.recycle( ShadowParticle.class )).resetUp( x, y );
}
 
Example #24
Source File: ShadowParticle.java    From YetAnotherPixelDungeon with GNU General Public License v3.0 4 votes vote down vote up
@Override
public void emit( Emitter emitter, int index, float x, float y ) {
    ((ShadowParticle)emitter.recycle( ShadowParticle.class )).resetUp( x, y );
}
 
Example #25
Source File: LeafParticle.java    From shattered-pixel-dungeon with GNU General Public License v3.0 4 votes vote down vote up
@Override
public void emit( Emitter emitter, int index, float x, float y ) {
	LeafParticle p = ((LeafParticle)emitter.recycle( LeafParticle.class ));
	p.color( ColorMath.random( Dungeon.level.color1, Dungeon.level.color2 ) );
	p.reset( x, y );
}
 
Example #26
Source File: FistSprite.java    From shattered-pixel-dungeon with GNU General Public License v3.0 4 votes vote down vote up
@Override
protected Emitter createEmitter() {
	Emitter emitter = emitter();
	emitter.pour(SparkParticle.STATIC, 0.06f );
	return emitter;
}
 
Example #27
Source File: LeafParticle.java    From YetAnotherPixelDungeon with GNU General Public License v3.0 4 votes vote down vote up
@Override
public void emit( Emitter emitter, int index, float x, float y ) {
	LeafParticle p = ((LeafParticle)emitter.recycle( LeafParticle.class ));
	p.color( ColorMath.random( Dungeon.level.color1, Dungeon.level.color2 ) );
	p.reset( x, y );
}
 
Example #28
Source File: MagicMissile.java    From shattered-pixel-dungeon with GNU General Public License v3.0 4 votes vote down vote up
@Override
public void emit( Emitter emitter, int index, float x, float y ) {
	((EarthParticle)emitter.recycle( EarthParticle.class )).resetBurst( x, y );
}
 
Example #29
Source File: ShaftParticle.java    From shattered-pixel-dungeon-gdx with GNU General Public License v3.0 4 votes vote down vote up
@Override
public void emit( Emitter emitter, int index, float x, float y ) {
	((ShaftParticle)emitter.recycle( ShaftParticle.class )).reset( x, y );
}
 
Example #30
Source File: AcidParticle.java    From YetAnotherPixelDungeon with GNU General Public License v3.0 4 votes vote down vote up
@Override
public void emit( Emitter emitter, int index, float x, float y ) {
    ((AcidParticle)emitter.recycle( AcidParticle.class )).resetBurst( x, y );
}