Exemplo n.º 1
0
  // Kill if dead
  public void processEntity(Entity entity, float deltaTime) {
    if (Mappers.life.get(entity).justDied) {
      Mappers.life.get(entity).updateJustDied();
      if (Mappers.type.get(entity).type == TypeComponent.EntityType.Altar) {
        UltraManager.setState(UltraManager.State.GameOverDialog);
        return;
      }
      if (Mappers.enemy.has(entity)) {
        if (--SpawnSystem.aliveEnemies == 0 && SpawnSystem.lastRound) {

          ItemFactory.spawnAltarEnabler(
              Mappers.position.get(entity).x,
              Mappers.position.get(entity).y,
              ItemSpawnSystem.getAltarEnablerId());
        }
      }
      AudioManager.kill.play();
      PositionComponent pos = Mappers.position.get(entity);
      FXFactory.makeDissapearEnemy(
          pos.x, pos.y, Mappers.enemy.get(entity), Mappers.render_comp.get(entity).invert);
      engine.removeEntity(entity);
    }
  }
Exemplo n.º 2
0
 /** Removes all entities registered with this Engine. */
 public void removeAllEntities() {
   while (entities.size > 0) {
     removeEntity(entities.first());
   }
 }