public void update(Player player) {
    if (!isDead()) {
      if (hostile) {
        Scenery tileToMoveTo = findBestStart(player);
        if (tileToMoveTo != null) {
          gameMap.applyMove(tileToMoveTo.getX(), tileToMoveTo.getY(), this);
        }
        gameMap.deleteParents();
      } else {
        int index = new Random().nextInt(4);
        switch (index) {
        case 0:
          moveUp();
          break;
        case 1:
          moveDown();
          break;
        case 2:
          moveLeft();
          break;
        case 3:
          moveRight();
          break;
        }
      }
    }
  }