Beispiel #1
0
  public void explode() {
    hp = 0;
    alive = false;
    Filter filter = body.getFixtureList().get(0).getFilterData();
    filter.categoryBits = GM.NOTHING_CATEGORY_BITS;
    body.getFixtureList().get(0).setFilterData(filter);
    body.setGravityScale(0);
    body.setLinearVelocity(0, 0);
    Array<ParticleEffect> particleEffects = playScreen.getParticleEffectArray();
    ActorBuilder.createExplodeEffect(x, y, particleEffects);

    if (leftThrottleSoundId >= 0) {
      throttleSound.pause(leftThrottleSoundId);
    }
    if (rightThrottleSoundId >= 0) {
      throttleSound.pause(rightThrottleSoundId);
    }
    explosionSound.play(GM.soundVolume, 1f, (x - 10f) / 20f);
  }
 public Enemy(PlayScreen playScreen, float x, float y) {
   super(playScreen, x, y);
   this.textureAtlas = playScreen.getTextureAtlas();
 }