use of com.watabou.noosa.particles.Emitter in project shattered-pixel-dungeon-gdx by 00-Evan.
the class BlacksmithSprite method link.
@Override
public void link(Char ch) {
super.link(ch);
emitter = new Emitter();
emitter.autoKill = false;
emitter.pos(x + 7, y + 12);
parent.add(emitter);
}
use of com.watabou.noosa.particles.Emitter in project shattered-pixel-dungeon-gdx by 00-Evan.
the class CharSprite method emitter.
public Emitter emitter() {
Emitter emitter = GameScene.emitter();
emitter.pos(this);
return emitter;
}
use of com.watabou.noosa.particles.Emitter in project shattered-pixel-dungeon-gdx by 00-Evan.
the class CharSprite method bottomEmitter.
public Emitter bottomEmitter() {
Emitter emitter = GameScene.emitter();
emitter.pos(x, y + height, width, 0);
return emitter;
}
use of com.watabou.noosa.particles.Emitter in project shattered-pixel-dungeon-gdx by 00-Evan.
the class StatusPane method update.
@Override
public void update() {
super.update();
float health = Dungeon.hero.HP;
float shield = Dungeon.hero.SHLD;
float max = Dungeon.hero.HT;
if (!Dungeon.hero.isAlive()) {
avatar.tint(0x000000, 0.5f);
} else if ((health / max) < 0.3f) {
warning += Game.elapsed * 5f * (0.4f - (health / max));
warning %= 1f;
avatar.tint(ColorMath.interpolate(warning, warningColors), 0.5f);
} else {
avatar.resetColor();
}
hp.scale.x = Math.max(0, (health - shield) / max);
shieldedHP.scale.x = health / max;
rawShielding.scale.x = shield / max;
exp.scale.x = (width / exp.width) * Dungeon.hero.exp / Dungeon.hero.maxExp();
if (Dungeon.hero.lvl != lastLvl) {
if (lastLvl != -1) {
Emitter emitter = (Emitter) recycle(Emitter.class);
emitter.revive();
emitter.pos(27, 27);
emitter.burst(Speck.factory(Speck.STAR), 12);
}
lastLvl = Dungeon.hero.lvl;
level.text(Integer.toString(lastLvl));
level.measure();
level.x = 27.5f - level.width() / 2f;
level.y = 28.0f - level.baseLine() / 2f;
PixelScene.align(level);
}
int tier = Dungeon.hero.tier();
if (tier != lastTier) {
lastTier = tier;
avatar.copy(HeroSprite.avatar(Dungeon.hero.heroClass, tier));
}
}
use of com.watabou.noosa.particles.Emitter in project shattered-pixel-dungeon-gdx by 00-Evan.
the class BossHealthBar method createChildren.
@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);
}
Aggregations