
GameMode gameMode;
int ScreenWidth = 1920;
int ScreenHeight = 1080;
//int ScreenHeight = 540;
//int ScreenWidth = 960;
int verlierer = 0;
int lossCondition = 0;
int schwierigkeit = 0;
PImage warmWater1;
PImage warmWater2;
PImage warmWater3;
PImage icePick;
PImage booster;
PImage character1;
PImage eyes1;
PImage character2;
PImage eyes2;
PImage character3;
PImage eyes3;
PImage character4;
PImage eyes4;
PImage intro;
PImage ziel;
PImage background;
PImage img;
//Bilddateien für die Spielwelt ränder
PImage randO1;
PImage randO2;
PImage randU1;
PImage randU2;
/*PImage iceBergwellen1;
 PImage iceBergwellen2;
 PImage iceBergwellen3;
 PImage iceFloegwellen1;
 PImage iceFloegwellen2;
 PImage iceFloegwellen3;
 PImage warmWaterwellen1;
 PImage warmWaterwellen2;
 PImage warmWaterwellen3;
 */
PImage dampfer;
int currentCharacter1; 
int currentCharacter2;
PImage schild1000;
PImage schild750;
PImage schild500;
PImage schild250;
PImage winnerBack;
PImage winnerFront;
PImage character1full;
PImage character2full;
PImage character3full;
PImage character4full;
PImage beginner;
PImage advanced;
PImage pro;
PImage helpSchrift;
PImage startSchrift;

float aspectRatio;

// enum um Schwierigkeiten festzulegen
static abstract class Schwierigkeit {
  static final int LOW = 0;
  static final int NORM = 1;
  static final int PRO = 2;
}

void setup() {
  fullScreen(P2D); //Size of the Screen (right now the background image in GameWorld is this size
  //size(960, 540, P2D);
  smooth();
  frameRate(60);
  ScreenWidth = width;
  ScreenHeight = height;
  /*
  warmWater1 = loadImage("assets/warmwater.png");

  warmWater2 = loadImage("assets/warmwater_2.png");
  */
  warmWater3 = loadImage("assets/warmwater_3.png");
 
  icePick = loadImage("assets/icePick.png");
  booster = loadImage("assets/booster.png");
  character1 = loadImage( "assets/character_01_body.png");
  eyes1 =loadImage( "assets/character_01_eyes.png");
  character2 = loadImage( "assets/character_02_body.png");
  eyes2 =loadImage( "assets/character_02_eyes.png");
  character3 = loadImage( "assets/character_03_body.png");
  eyes3 =loadImage( "assets/character_03_eyes.png");
  character4 = loadImage( "assets/character_04_body.png");
  eyes4 =loadImage( "assets/character_04_eyes.png");
  intro =loadImage( "assets/intro.png");
  ziel =loadImage( "assets/ziel.png");
  //ziel.resize(ziel.width-150, ziel.height-150);
  background = loadImage( "assets/Play_Screen.png");
  randO1 = loadImage("assets/Rand_oben_01.png");
  randO2 = loadImage("assets/Rand_oben_02.png");
  randU1 = loadImage("assets/Rand_unten_01.png");
  randU2 = loadImage("assets/Rand_unten_01.png");
  img = loadImage("assets/Play_Screen.png");
  schild1000 = loadImage("assets/schild.png");
  schild500 = loadImage("assets/schild03.png");
  schild250 = loadImage("assets/schild04.png");
  schild750 =loadImage("assets/schild02.png");
  winnerBack = loadImage("assets/sieger background.png");
  winnerFront = loadImage("assets/sieger foreground.png");
  character1full =loadImage("assets/character_01.png");
  character2full =loadImage("assets/character_02.png");
  character3full =loadImage("assets/character_03.png");
  character4full =loadImage("assets/character_04.png");
  schild1000.resize(schild1000.width/2, schild1000.height/2);
  schild500.resize(schild500.width/2, schild500.height/2);
  schild250.resize(schild250.width/2, schild250.height/2);
  schild750.resize(schild750.width/2, schild750.height/2);
  img.resize(width, height);
  /*
  iceBergwellen1 = loadImage("assets/eisber_wellen_1.png");
   iceBergwellen2 = loadImage("assets/eisber_wellen_2.png");
   iceBergwellen3 = loadImage("assets/eisber_wellen_3.png");
   iceFloegwellen1 = loadImage("assets/wellen_floe_1.png");
   iceFloegwellen2= loadImage("assets/wellen_floe_2.png");
   iceFloegwellen3= loadImage("assets/wellen_floe_3.png");
   */
  dampfer = loadImage("assets/dampfer.png");
  advanced = loadImage("assets/mittel.png");
  beginner = loadImage("assets/einfach.png");
  pro = loadImage("assets/schwierig.png");
  helpSchrift = loadImage("assets/Hilfe.png");
  startSchrift = loadImage("assets/Start_de.png");

  aspectRatio = (float)ScreenWidth/(float)ScreenHeight;
  println(aspectRatio);

  gameMode = new HomeMode(); //creates a HomeMode

  currentCharacter1 = 1;
  currentCharacter2 = 2;
  //noCursor();
}

void draw() {
  gameMode.draw();
  //println(frameRate); //for debugging
}

void mouseClicked() {
  gameMode.mouseClicked();
}

void mouseReleased() {
  gameMode.mouseReleased();
}

void keyPressed() {
  gameMode.keyPressed();
  if (key == 'm') {
    saveFrame(); 
  }
}

void keyReleased() {
  gameMode.keyReleased();
}
