Search in sources :

Example 21 with Emitter

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;
}
Also used : Emitter(com.watabou.noosa.particles.Emitter) PointF(com.watabou.utils.PointF)

Example 22 with 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;
}
Also used : Emitter(com.watabou.noosa.particles.Emitter) PointF(com.watabou.utils.PointF)

Example 23 with 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);
}
Also used : Emitter(com.watabou.noosa.particles.Emitter) NinePatch(com.watabou.noosa.NinePatch) WndGame(com.watabou.pixeldungeon.windows.WndGame) Touch(com.watabou.input.Touchscreen.Touch) Image(com.watabou.noosa.Image) CompositeTextureImage(com.watabou.noosa.CompositeTextureImage) WndHero(com.watabou.pixeldungeon.windows.WndHero) WndHats(com.watabou.pixeldungeon.windows.WndHats) TouchArea(com.watabou.noosa.TouchArea) BitmapText(com.watabou.noosa.BitmapText) WndHeroSpells(com.nyrds.pixeldungeon.windows.WndHeroSpells)

Example 24 with Emitter

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;
    }
}
Also used : Emitter(com.watabou.noosa.particles.Emitter)

Example 25 with Emitter

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);
}
Also used : Group(com.watabou.noosa.Group) Emitter(com.watabou.noosa.particles.Emitter) Image(com.watabou.noosa.Image)

Aggregations

Emitter (com.watabou.noosa.particles.Emitter)48 PointF (com.watabou.utils.PointF)9 Image (com.watabou.noosa.Image)6 Group (com.watabou.noosa.Group)4 BitmapText (com.watabou.noosa.BitmapText)2 BlobEmitter (com.watabou.pixeldungeon.effects.BlobEmitter)2 ItemSprite (com.watabou.pixeldungeon.sprites.ItemSprite)2 WndHeroSpells (com.nyrds.pixeldungeon.windows.WndHeroSpells)1 BlobEmitter (com.shatteredpixel.shatteredpixeldungeon.effects.BlobEmitter)1 CellEmitter (com.shatteredpixel.shatteredpixeldungeon.effects.CellEmitter)1 Touch (com.watabou.input.Touchscreen.Touch)1 CompositeTextureImage (com.watabou.noosa.CompositeTextureImage)1 NinePatch (com.watabou.noosa.NinePatch)1 TouchArea (com.watabou.noosa.TouchArea)1 BitmaskEmitter (com.watabou.noosa.particles.BitmaskEmitter)1 Barkskin (com.watabou.pixeldungeon.actors.buffs.Barkskin)1 Hero (com.watabou.pixeldungeon.actors.hero.Hero)1 CellEmitter (com.watabou.pixeldungeon.effects.CellEmitter)1 Dewdrop (com.watabou.pixeldungeon.items.Dewdrop)1 Herbalism (com.watabou.pixeldungeon.items.rings.RingOfHerbalism.Herbalism)1