public void update() {
    // System.out.println(gameConfiguration.mute);
    if (gameStatus == -1) {
      return;
    }
    if ((gameStatus == 1) || (gameStatus == 9)) {
      mouseGrabbed = false;
      Main.mouseGrabbed(mouseGrabbed);
      // gameConfiguration.update();
    }

    if (gameStatus == 2) {

      Main.mouseGrabbed(mouseGrabbed);
      if (pause) {
        mouseGrabbed = false;
        return;
      } else {
        mouseGrabbed = true;
      }
      Main.mouseGrabbed(mouseGrabbed);
      gameConfiguration.update();
      script();
      //        prism.update();
      if (blackHole != null) blackHole.update();

      for (GO ob : allObjects) {
        ob.update();
      }
      for (GOPlayer obPlayer : players) {
        blackHole.setGravitationPower(obPlayer);
        obPlayer.update();
        if (restartGame) break;
        else
          for (GOPoint point : obPlayer.path) {
            point.update();
          }
        //            obPlayer.danger = false;
      }
      if (restartGame) {
        Main.restartGame();
        return;
      }
      do {
        somethingWasChanged = false;
        for (GO p : obstacles) {
          p.update();
          if (somethingWasChanged) break;
        }
        for (GOPrism bonus : bonuses) {
          bonus.update();
          if (somethingWasChanged) break;
        }
      } while (somethingWasChanged);
    }
  }
  public void render() {
    switch (gameStatus) {
      case -1:
        break;
      case 1:
      case 2:
      case 9:
        //        distance += 0.2;
        if (Main.game.player.funX >= GOPlayer.beginX
            && (gameConfiguration.playersAmount + gameConfiguration.isBot < 2)) {
          Draw.xshift = (float) Math.pow(Main.game.player.funX - GOPlayer.beginX, 1f);
        } else Draw.xshift = 0;
        if (distance * moveOnStep >= 20) distance = 0;
        Draw.draw(DrawFigure.FON2, 0, 20 * Main.ratio, 150, 60 * Main.ratio);

        for (GO ob : allObjects) {
          ob.render();
        }
        for (GOPlayer obPlayer : players) {
          for (GOPoint point : obPlayer.path) {
            point.render();
          }
          obPlayer.render();
        }
        for (GO ob : obstacles) {
          ob.render();
        }
        for (GOPrism bonus : bonuses) {
          bonus.render();
        }
        Draw.gameInterface();
        if ((gameStatus == 1) || (gameStatus == 9)) {
          if (changedGameStatus) Draw.wallpaper = Draw.shadowTexture;
          changedGameStatus = false;
        } else {

          return;
        }
        break;
      case 3:
        changedGameStatus = false;
        break;
      case 4:
        if (changedGameStatus) Draw.wallpaper = loadTexture("fon/textureWithShadow");
        changedGameStatus = false;

        break;
      case 0:
        if (changedGameStatus) {
          Draw.wallpaper = Draw.wallTexture;
          changedGameStatus = false;
        }
        break;

      case 10:
        if (changedGameStatus) {
          Draw.wallpaper = Draw.wallTexture;
          changedGameStatus = false;
        }
        break;
    }
    Draw.drawWallpaper(Draw.wallpaper);
    selected = checkButtonIsOver();

    Draw.drawContextMenu(gameStatus, selected);

    if (gameStatus == 3) Draw.drawTopScoreList(pg, maxPg);

    // Draw.drawCoords();
    if (gameStatus == -1) {
      // Draw.drawGradient(Draw.gradient, shadowing);
      // System.out.println(shadowing);

    } else {
      Draw.drawFPS();
    }
  }