public void add(State state) { switch (state) { case BURNING: burning = emitter(); burning.pour(FlameParticle.FACTORY, 0.06f); if (getVisible()) { Sample.INSTANCE.play(Assets.SND_BURNING); } break; case LEVITATING: levitation = emitter(); levitation.pour(Speck.factory(Speck.JET), 0.02f); break; case INVISIBLE: PotionOfInvisibility.melt(ch); break; case PARALYSED: paused = true; break; case FROZEN: iceBlock = IceBlock.freeze(this); paused = true; break; case ILLUMINATED: GameScene.effect(halo = new TorchHalo(this)); break; } }
@Override protected void createChildren() { shield = new NinePatch(Assets.STATUS, 80, 0, 30 + 18, 0); add(shield); add( new TouchArea(0, 1, 31, 31) { @Override protected void onClick(Touch touch) { Image sprite = Dungeon.hero.sprite; if (!sprite.isVisible()) { Camera.main.focusOn(sprite); } GameScene.show(new WndHero()); } }); btnMenu = new MenuButton(); add(btnMenu); avatar = HeroSprite.avatar(Dungeon.hero.heroClass, lastTier); add(avatar); blood = new Emitter(); blood.pos(avatar); blood.pour(BloodParticle.FACTORY, 0.3f); blood.autoKill = false; blood.on = false; add(blood); compass = new Compass(Dungeon.level.exit); add(compass); hp = new Image(Assets.HP_BAR); add(hp); 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); Dungeon.hero.belongings.countIronKeys(); keys = new BitmapText(PixelScene.font1x); keys.hardlight(0xCACFC2); add(keys); danger = new DangerIndicator(); add(danger); buffs = new BuffIndicator(Dungeon.hero); add(buffs); }
@Override public void link(Char ch) { super.link(ch); if (cloud == null) { cloud = emitter(); cloud.pour(Speck.factory(Speck.TOXIC), 0.7f); } }