use of com.watabou.noosa.tweeners.AlphaTweener in project shattered-pixel-dungeon-gdx by 00-Evan.
the class CharSprite method add.
public void add(State state) {
switch(state) {
case BURNING:
burning = emitter();
burning.pour(FlameParticle.FACTORY, 0.06f);
if (visible) {
Sample.INSTANCE.play(Assets.SND_BURNING);
}
break;
case LEVITATING:
levitation = emitter();
levitation.pour(Speck.factory(Speck.JET), 0.02f);
break;
case INVISIBLE:
if (invisible != null) {
invisible.killAndErase();
}
invisible = new AlphaTweener(this, 0.4f, 0.4f);
if (parent != null) {
parent.add(invisible);
} else
alpha(0.4f);
break;
case PARALYSED:
paused = true;
break;
case FROZEN:
iceBlock = IceBlock.freeze(this);
paused = true;
break;
case ILLUMINATED:
GameScene.effect(halo = new TorchHalo(this));
break;
case CHILLED:
chilled = emitter();
chilled.pour(SnowParticle.FACTORY, 0.1f);
break;
case DARKENED:
darkBlock = DarkBlock.darken(this);
break;
case MARKED:
marked = emitter();
marked.pour(ShadowParticle.UP, 0.1f);
break;
case HEALING:
healing = emitter();
healing.pour(Speck.factory(Speck.HEALING), 0.5f);
}
}
use of com.watabou.noosa.tweeners.AlphaTweener in project shattered-pixel-dungeon-gdx by 00-Evan.
the class CityBossLevel method press.
@Override
public void press(int cell, Char hero) {
super.press(cell, hero);
if (!enteredArena && outsideEntraceRoom(cell) && hero == Dungeon.hero) {
enteredArena = true;
seal();
for (Mob m : mobs) {
// bring the first ally with you
if (m.alignment == Char.Alignment.ALLY) {
m.pos = Dungeon.hero.pos + (Random.Int(2) == 0 ? +1 : -1);
m.sprite.place(m.pos);
break;
}
}
King boss = new King();
boss.state = boss.WANDERING;
int count = 0;
do {
boss.pos = Random.Int(length());
} while (!passable[boss.pos] || !outsideEntraceRoom(boss.pos) || (heroFOV[boss.pos] && count++ < 20));
GameScene.add(boss);
if (heroFOV[boss.pos]) {
boss.notice();
boss.sprite.alpha(0);
boss.sprite.parent.add(new AlphaTweener(boss.sprite, 1, 0.1f));
}
set(arenaDoor, Terrain.LOCKED_DOOR);
GameScene.updateMap(arenaDoor);
Dungeon.observe();
}
}
use of com.watabou.noosa.tweeners.AlphaTweener in project pixel-dungeon-remix by NYRDS.
the class DungeonTilemap method discover.
public void discover(int pos) {
final Image tile = tile(pos);
if (tile == null) {
return;
}
tile.point(tileToWorld(pos));
// For bright mode
tile.rm = tile.gm = tile.bm = rm;
tile.ra = tile.ga = tile.ba = ra;
getParent().add(tile);
getParent().add(new AlphaTweener(tile, 0, 0.6f) {
protected void onComplete() {
tile.killAndErase();
killAndErase();
}
});
}
use of com.watabou.noosa.tweeners.AlphaTweener in project pixel-dungeon-remix by NYRDS.
the class Wraith method spawnAt.
public static Wraith spawnAt(int pos) {
if (Dungeon.level.passable[pos] && Actor.findChar(pos) == null) {
Wraith w = new Wraith();
w.adjustStats(Dungeon.depth);
w.setPos(pos);
w.setState(w.HUNTING);
Dungeon.level.spawnMob(w, SPAWN_DELAY);
w.getSprite().alpha(0);
w.getSprite().getParent().add(new AlphaTweener(w.getSprite(), 1, 0.5f));
w.getSprite().emitter().burst(ShadowParticle.CURSE, 5);
return w;
} else {
return null;
}
}
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;
}
}
Aggregations