Search in sources :

Example 1 with AlphaTweener

use of com.watabou.noosa.tweeners.AlphaTweener in project pixel-dungeon by watabou.

the class WandOfBlink method appear.

public static void appear(Char ch, int pos) {
    ch.sprite.interruptMotion();
    ch.move(pos);
    ch.sprite.place(pos);
    if (ch.invisible == 0) {
        ch.sprite.alpha(0);
        ch.sprite.parent.add(new AlphaTweener(ch.sprite, 1, 0.4f));
    }
    ch.sprite.emitter().start(Speck.factory(Speck.LIGHT), 0.2f, 3);
    Sample.INSTANCE.play(Assets.SND_TELEPORT);
}
Also used : AlphaTweener(com.watabou.noosa.tweeners.AlphaTweener)

Example 2 with AlphaTweener

use of com.watabou.noosa.tweeners.AlphaTweener in project pixel-dungeon by watabou.

the class BuffIndicator method layout.

@Override
protected void layout() {
    clear();
    SparseArray<Image> newIcons = new SparseArray<Image>();
    for (Buff buff : ch.buffs()) {
        int icon = buff.icon();
        if (icon != NONE) {
            Image img = new Image(texture);
            img.frame(film.get(icon));
            img.x = x + members.size() * (SIZE + 2);
            img.y = y;
            add(img);
            newIcons.put(icon, img);
        }
    }
    for (Integer key : icons.keyArray()) {
        if (newIcons.get(key) == null) {
            Image icon = icons.get(key);
            icon.origin.set(SIZE / 2);
            add(icon);
            add(new AlphaTweener(icon, 0, 0.6f) {

                @Override
                protected void updateValues(float progress) {
                    super.updateValues(progress);
                    image.scale.set(1 + 5 * progress);
                }

                ;
            });
        }
    }
    icons = newIcons;
}
Also used : SparseArray(com.watabou.utils.SparseArray) AlphaTweener(com.watabou.noosa.tweeners.AlphaTweener) Image(com.watabou.noosa.Image) Buff(com.watabou.pixeldungeon.actors.buffs.Buff)

Example 3 with AlphaTweener

use of com.watabou.noosa.tweeners.AlphaTweener in project pixel-dungeon by watabou.

the class Ghost method replace.

public static void replace(final Mob a, final Mob b) {
    final float FADE_TIME = 0.5f;
    a.destroy();
    a.sprite.parent.add(new AlphaTweener(a.sprite, 0, FADE_TIME) {

        protected void onComplete() {
            a.sprite.killAndErase();
            parent.erase(this);
        }

        ;
    });
    b.pos = a.pos;
    GameScene.add(b);
    b.sprite.flipHorizontal = a.sprite.flipHorizontal;
    b.sprite.alpha(0);
    b.sprite.parent.add(new AlphaTweener(b.sprite, 1, FADE_TIME));
}
Also used : AlphaTweener(com.watabou.noosa.tweeners.AlphaTweener)

Example 4 with AlphaTweener

use of com.watabou.noosa.tweeners.AlphaTweener in project pixel-dungeon by watabou.

the class DungeonTilemap method discover.

public void discover(int pos, int oldValue) {
    final Image tile = tile(oldValue);
    tile.point(tileToWorld(pos));
    // For bright mode
    tile.rm = tile.gm = tile.bm = rm;
    tile.ra = tile.ga = tile.ba = ra;
    parent.add(tile);
    parent.add(new AlphaTweener(tile, 0, 0.6f) {

        protected void onComplete() {
            tile.killAndErase();
            killAndErase();
        }

        ;
    });
}
Also used : AlphaTweener(com.watabou.noosa.tweeners.AlphaTweener) Image(com.watabou.noosa.Image)

Example 5 with AlphaTweener

use of com.watabou.noosa.tweeners.AlphaTweener in project pixel-dungeon by watabou.

the class Wraith method spawnAt.

public static Wraith spawnAt(int pos) {
    if (Level.passable[pos] && Actor.findChar(pos) == null) {
        Wraith w = new Wraith();
        w.adjustStats(Dungeon.depth);
        w.pos = pos;
        w.state = w.HUNTING;
        GameScene.add(w, SPAWN_DELAY);
        w.sprite.alpha(0);
        w.sprite.parent.add(new AlphaTweener(w.sprite, 1, 0.5f));
        w.sprite.emitter().burst(ShadowParticle.CURSE, 5);
        return w;
    } else {
        return null;
    }
}
Also used : AlphaTweener(com.watabou.noosa.tweeners.AlphaTweener)

Aggregations

AlphaTweener (com.watabou.noosa.tweeners.AlphaTweener)8 Image (com.watabou.noosa.Image)2 Buff (com.watabou.pixeldungeon.actors.buffs.Buff)1 Mob (com.watabou.pixeldungeon.actors.mobs.Mob)1 Bee (com.watabou.pixeldungeon.actors.mobs.npcs.Bee)1 Pushing (com.watabou.pixeldungeon.effects.Pushing)1 SparseArray (com.watabou.utils.SparseArray)1 ArrayList (java.util.ArrayList)1