コード例 #1
3
  @Override
  public void onComplete(Animation anim) {
    super.onComplete(anim);

    if (visible && emitter != null && anim == idle) {
      emitter.burst(Speck.factory(Speck.FORGE), 3);
      float volume = 0.2f / (Level.distance(ch.pos, Dungeon.hero.pos));
      Sample.INSTANCE.play(Assets.SND_EVOKE, volume, volume, 0.8f);
    }
  }
コード例 #2
0
  @Override
  public void update() {
    super.update();

    float health = (float) Dungeon.hero.HP / Dungeon.hero.HT;

    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;
    exp.scale.x = (width / exp.width) * Dungeon.hero.exp / Dungeon.hero.maxExp();

    if (Dungeon.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 = Dungeon.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;
    }

    int tier = Dungeon.hero.tier();
    if (tier != lastTier) {
      lastTier = tier;
      avatar.copy(HeroSprite.avatar(Dungeon.hero.heroClass, tier));
    }
  }
コード例 #3
0
ファイル: Splash.java プロジェクト: royleon4/PD-ice
  public static void at(PointF p, final float dir, final float cone, final int color, int n) {

    if (n <= 0) {
      return;
    }

    Emitter emitter = GameScene.emitter();
    emitter.pos(p);

    FACTORY.color = color;
    FACTORY.dir = dir;
    FACTORY.cone = cone;
    emitter.burst(FACTORY, n);
  }
コード例 #4
0
ファイル: Splash.java プロジェクト: royleon4/PD-ice
  public static void at(PointF p, final int color, int n) {

    if (n <= 0) {
      return;
    }

    Emitter emitter = GameScene.emitter();
    emitter.pos(p);

    FACTORY.color = color;
    FACTORY.dir = -3.1415926f / 2;
    FACTORY.cone = 3.1415926f;
    emitter.burst(FACTORY, n);
  }