@Override
  public void render(float delta) {
    while (enPause)
      try {
        Thread.sleep(100);
      } catch (InterruptedException e) {
        e.printStackTrace();
      }
    // System.out.println(human.getScore());

    ia.play();
    // if (new Random().nextInt() % 300 == 1)
    // entitiesToRender.add(new Gap(1100, 200));

    animTime += Gdx.graphics.getDeltaTime();
    stage.act(delta);
    stage.getSpriteBatch().begin();

    stage.getSpriteBatch().draw(bgSprite, 0, 0);
    bg.render(stage.getSpriteBatch());
    entitiesToRender.removeAll(entitiesToRemove);
    for (Entity entity : entitiesToRender) {
      stage.getSpriteBatch().draw(entity.getFrame(animTime), entity.getX(), entity.getY());
    }
    buchers.render(stage.getSpriteBatch(), animTime);
    stage.getSpriteBatch().draw(tree.getFrame(animTime), tree.getX(), tree.getY());

    if (enPause == true) {
      pause.getSprite().draw(stage.getSpriteBatch());
    }

    score.draw(
        stage.getSpriteBatch(),
        "SCORE : " + GameScreen.getInstance().getHuman().getScore(),
        50,
        50);

    stage.getSpriteBatch().end();

    if (Team.getInstance().allLeaved()) {
      Team.getInstance().reset();
    }
  }
 public void changeMode() {
   human.toggleMode();
   ia.toggleMode();
 }