
class GameEndsMode extends GameMode {
  PImage c1;
  PImage c2;






  void draw() {

    
    background(40);

    if (currentCharacter1 ==1) {
      c1 = character1full;
    } else if (currentCharacter1 ==2) {
      c1 = character2full;
    } else if (currentCharacter1 ==3) {
      c1 = character3full;
    } else {
      c1 = character4full;
    }
    if (currentCharacter2 ==1) {
      c2 = character1full;
    } else if (currentCharacter2 ==2) {
      c2 = character2full;
    } else if (currentCharacter2 ==3) {
      c2 = character3full;
    } else {
      c2 = character4full;
    }

    textAlign(CENTER);
    textSize(60);
    fill(#78ECF7);
    noStroke();
    rect(0, 0, width/2, height);
    fill(#788EF7);
    rect(width/2, 0, width/2, height);
    fill(255, 255, 255, 100);
    textSize(30);
    fill(0);
    text("klicke um nocheinmal zu spielen", width/2, height/2+250);

    fill(0);
    stroke(5);

    textSize(60);
    if (verlierer == 1) {
      text("Gewonnen", width/4 *3, height/2+50);
      text("Verloren", width/4, height/2+50);
      image(c1, width/4, height/3, 100, 100);
      image(winnerBack, 3*width/4, height/3, 300, 300);
      image(c2, 3*width/4, height/3, 200, 200);
      image(winnerFront, 3*width/4, height/3, 300, 300);

      if (lossCondition == 1) {
        textSize(25);
        text("Du bist zu klein geschmolzen!", width/4, height/2 +100);
      }
    }
    if (verlierer == 2) {
      text("Verloren", width/4 *3, height/2+50);
      text("Gewonnen", width/4, height/2+50);
      image(winnerBack, width/4, height/3, 300, 300);
      image(c1, width/4, height/3, 200, 200);
      image(winnerFront, width/4, height/3, 300, 300);
      image(c2, 3*width/4, height/3, 100, 100);
      if (lossCondition == 1) {
        textSize(25);
        text("Du bist zu klein geschmolzen!", 3* width/4, height/2+100);
      }
    }
    if (lossCondition == 2) {
      textSize(35);
    }
    if (verlierer ==0) {
      image(c1, width/4, height/3, 200, 200);
      image(c2, 3*width/4, height/3, 220, 200);
      text("Unentschieden", width/4 *3, height/2+50);
      text("Unentschieden", width/4, height/2+50);
    }
  }

  void mouseClicked() {
    verlierer = 0;
    lossCondition = 0;
    gameMode = new GameSetup(); //geht nicht wegen Timer problemen
  }
}
