     }
   }
   while (1) {
-    if (analogRead(b11) < analogRead(b21) && analogRead(b11) < 100) {
+    if (button11.flagClick == 1) {
       lcd.setCursor(0, 0); lcd.print("Green plr wins!");
       game = GAME_PERFORMED;
       x = 5; y = 2; vector = 1;
       return;
     }
-    else if (analogRead(b21) < analogRead(b11) && analogRead(b21) < 100) {
+    else if (button21.flagClick == 1) {
       lcd.setCursor(0, 0); lcd.print("Red plr wins!");
       game = GAME_PERFORMED;
       x = 6; y = 2; vector = -1;

}

void in_game() {
  digitalWrite(field[x][y], HIGH);
  delay(1000);
  digitalWrite(field[x][y], LOW );
  if ((analogRead(b14) < 100) || (analogRead(b24) < 100)) {
    x = x +  vector;
  }
  if ((analogRead(b13) < 100) || (analogRead(b23) < 100)) {
    x = x -  vector;
  }
  if ((analogRead(b22) < 100) || (analogRead(b12) < 100)) {
    y = y + vector;
  }
  if ((analogRead(b15) < 100) || (analogRead(b25) < 100)) {
    y = y - vector;
  }
}

  for (int i = 2; i <= 13; i++) { //init rgb leds
    pinMode(i, OUTPUT);
  }
}

void start_game() {
  game = 999;
  lcd.init();
  button11.flagClick = 0;
  button21.flagClick = 0;
  for (int j = 1000; j > 0; j = j - 100 ) {
    for (int i = 2; i <= 13; i++) { //init rgb leds
      digitalWrite(i, HIGH);
