use of com.watabou.noosa.particles.Emitter in project pixel-dungeon-remix by NYRDS.
the class CellEmitter method get.
public static Emitter get(int cell) {
PointF p = DungeonTilemap.tileToWorld(cell);
Emitter emitter = GameScene.emitter();
if (emitter != null) {
emitter.pos(p.x, p.y, DungeonTilemap.SIZE, DungeonTilemap.SIZE);
}
return emitter;
}
use of com.watabou.noosa.particles.Emitter in project pixel-dungeon-remix by NYRDS.
the class CellEmitter method bottom.
public static Emitter bottom(int cell) {
PointF p = DungeonTilemap.tileToWorld(cell);
Emitter emitter = GameScene.emitter();
emitter.pos(p.x, p.y + DungeonTilemap.SIZE, DungeonTilemap.SIZE, 0);
return emitter;
}
use of com.watabou.noosa.particles.Emitter in project pixel-dungeon-remix by NYRDS.
the class StatusPane method createChildren.
@Override
protected void createChildren() {
shield = new NinePatch(Assets.getStatus(), 80, 0, 30 + 18, 0);
add(shield);
add(new TouchArea(0, 1, 30, 30) {
@Override
protected void onClick(Touch touch) {
Image sprite = hero.getSprite();
if (!sprite.isVisible()) {
Camera.main.focusOn(sprite);
}
GameScene.show(new WndHero());
}
});
avatar = hero.getHeroSprite().avatar();
add(avatar);
blood = new Emitter();
blood.pos(avatar);
blood.pour(BloodParticle.FACTORY, 0.3f);
blood.autoKill = false;
blood.on = false;
add(blood);
int compassTarget = currentLevel.entrance;
if (currentLevel.hasCompassTarget()) {
// Set to compass target if exists
compassTarget = currentLevel.getCompassTarget();
} else if (currentLevel.hasExit(0)) {
// Set to first exit if exists
compassTarget = currentLevel.getExit(0);
}
compass = new Compass(compassTarget, currentLevel);
add(compass);
hp = new Image(Assets.HP_BAR);
add(hp);
sp = new Image(Assets.SP_BAR);
add(sp);
exp = new Image(Assets.XP_BAR);
add(exp);
level = new BitmapText(PixelScene.font1x);
level.hardlight(0xFFEBA4);
add(level);
depth = new BitmapText(Integer.toString(Dungeon.depth), PixelScene.font1x);
depth.hardlight(0xCACFC2);
depth.measure();
add(depth);
hero.belongings.countIronKeys();
keys = new BitmapText(PixelScene.font1x);
keys.hardlight(0xCACFC2);
add(keys);
danger = new DangerIndicator();
add(danger);
loot = new LootIndicator();
add(loot);
buffs = new BuffIndicator(hero);
add(buffs);
btnMenu = new MenuButton(new Image(Assets.getStatus(), 114, 3, 12, 11), WndGame.class);
add(btnMenu);
btnHats = new MenuButton(new Image(Assets.getStatus(), 114, 18, 12, 11), WndHats.class);
btnSpells = new MenuButton(new Image(Assets.getStatus(), 2, 33, 12, 11), WndHeroSpells.class);
if (!Flavours.haveHats()) {
btnHats.enable(false);
}
if (!hero.spellUser) {
btnSpells.enable(false);
}
add(btnSpells);
add(btnHats);
}
use of com.watabou.noosa.particles.Emitter in project pixel-dungeon-remix by NYRDS.
the class StatusPane method update.
@Override
public void update() {
super.update();
float health = (float) hero.hp() / hero.ht();
float sPoints = (float) hero.getSoulPoints() / hero.getSoulPointsMax();
if (health == 0) {
avatar.tint(0x000000, 0.6f);
blood.on = false;
} else if (health < 0.25f) {
avatar.tint(0xcc0000, 0.4f);
blood.on = true;
} else {
avatar.resetColor();
blood.on = false;
}
hp.Scale().x = health;
sp.Scale().x = sPoints;
exp.Scale().x = (width / exp.width) * hero.getExp() / hero.maxExp();
if (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 = hero.lvl();
level.text(Integer.toString(lastLvl));
level.measure();
level.x = PixelScene.align(27.0f - level.width() / 2);
level.y = PixelScene.align(27.5f - level.baseLine() / 2);
}
int k = IronKey.curDepthQuantity;
if (k != lastKeys) {
lastKeys = k;
keys.text(Integer.toString(lastKeys));
keys.measure();
keys.x = width - 8 - keys.width() - 18;
}
}
use of com.watabou.noosa.particles.Emitter in project pixel-dungeon by watabou.
the class Fireball method createChildren.
@Override
protected void createChildren() {
sparks = new Group();
add(sparks);
bLight = new Image(Assets.FIREBALL);
bLight.frame(BLIGHT);
bLight.origin.set(bLight.width / 2);
bLight.angularSpeed = -90;
add(bLight);
emitter = new Emitter();
emitter.pour(new Emitter.Factory() {
@Override
public void emit(Emitter emitter, int index, float x, float y) {
Flame p = (Flame) emitter.recycle(Flame.class);
p.reset();
p.x = x - p.width / 2;
p.y = y - p.height / 2;
}
}, 0.1f);
add(emitter);
fLight = new Image(Assets.FIREBALL);
fLight.frame(FLIGHT);
fLight.origin.set(fLight.width / 2);
fLight.angularSpeed = 360;
add(fLight);
bLight.texture.filter(Texture.LINEAR, Texture.LINEAR);
}
Aggregations