Save int when you exit from the software

hello, I’m a game programmer using Processing
And I want the home screen to have a score table that shows the user what their highest score is.
I tried all kinds of ways to save a file, but didn’t quite understand.
So I want you to help me in the following way:
I’ll give you the full code of the game.
Read it and add whatever it takes to keep it going even when you go out.
The score I want to keep is called Score, you will see it in the code.
So just look at the code, add what’s needed and send me a code

The Code:

//cube = the thing allow to hide the play button on the settings screen.
//spiner = allow to home screen when you click the home screen on lose screen to press play
//dab.x = 9999 = when open the game
//dab.x = 9998 = when you lose
import java.security.*;
String cipher=null;
public static String bytesToHex(byte[] b) {
  char hexDigit[] = {
    '0', '1', '2', '3', '4', '5', '6', '7', 
    '8', '9', 'A', 'B', 'C', 'D', 'E', 'F'
  };
  StringBuffer buf = new StringBuffer();
  for (int j=0; j<b.length; j++) {
    buf.append(hexDigit[(b[j] >>4) & 0x0f]);
    buf.append(hexDigit[b[j] & 0x0f]);
  }
  return buf.toString();
}
Table table;

import ddf.minim.*;
int value = 0;
Minim minim;
AudioPlayer soundtrack;
PImage img;
PImage [] exp = new PImage[8];
final int MOUSE = 1;
final int KEYBOARD = 1;
final int JOYSTICK = 1;
String credit = "Lookat beta 0.8";
String name = "Lookat";
int score = 0;
//all the objects in the game:
Image background = new Image();//
Music success = new Music();
Music failed = new Music();
Image pirate = new Image();
Image bomb = new Image();
Image bomb2 = new Image();
Image bomb3 = new Image();
Image bomb4 = new Image();
Image bomb5 = new Image();
Image bomb6 = new Image();
Image heart1 = new Image();
Image heart2 = new Image();
Image heart3 = new Image();
Music over = new Music();
Image gameover = new Image();
Image home = new Image();
Image title = new Image();
Text copyright = new Text();
Image errors = new Image();
Image menu = new Image();
Image play = new Image();
Image play2 = new Image();
PVector pv = new PVector();
Image again = new Image();
Image settings = new Image();
Image settingscreen = new Image();
Image close = new Image();
Image mute = new Image();
Image unmute = new Image();
Image white = new Image();
Image exit = new Image();
Image cube = new Image();
Image spiner = new Image();
Image dab = new Image();
Image song = new Image();
Image ping = new Image();
Image tv = new Image();
Image pause = new Image();
Image pausescreen = new Image();
Image pausebackground = new Image();
Image pausetitle = new Image();
Image continuebutton = new Image();
Image restart = new Image();
Image menubutton = new Image();
Image mutebutton = new Image();
Image unmutebutton = new Image();
Image google = new Image();
SpriteSheet wave = new SpriteSheet();
int timeLeft;
int XYZ;
//that's all.

public void settings() {
  //size
  if (displayWidth == 1920 && displayHeight == 1080) {
    fullScreen();
  } else
    size(1366, 768);
}
void setup() {
  try {
    MessageDigest md = MessageDigest.getInstance("MD5");
    String input="aabbccddeeff"; //storing the password in input string
    md.update(input.getBytes()); //storing the password in md object as bytes
    byte[] output = md.digest(); //producing the 128 bit output using the md5 algorithm
    cipher= bytesToHex(output); //converting the bytes to string and storing in cipher String
  }
  catch (Exception e) {
    System.out.println("Exception: "+e);
  }
  println(cipher);
table = new Table();
  table.addColumn("score");
  table.addColumn("species");
  table.addColumn("score");
  TableRow newRow = table.addRow();
  newRow.setInt ("score", table.lastRowIndex());
  newRow.setString("species", "score");
  newRow.setString("score", "score");
  saveTable(table, "data/score.csv");
  //all the basic settings:
  background.setImage("background.jpg");
  background.y=0;
  minim=new Minim(this);
  soundtrack=minim.loadFile("soundtrack.mp3");
  soundtrack.loop();
  success.load("success.mp3");
  failed.load("failed.mp3");

  pirate.setImage("pirate ship.png");
  pirate.width=180;
  pirate.height=193;
  pirate.x=855;
  pirate.y=740;
  wave.imageBaseName="tile";
  wave.NumOfImage = 53;
  wave.x=9999;
  wave.y=9999;
  wave.animationFactor=2;
  bomb.setImage("bomb.png");
  cube.setImage("cube.jpg");
  cube.x=9998;
  cube.y=9998;
  spiner.setImage("spiner.jpg");
  spiner.x = 9998;
  spiner.y = 9998;
  google.x = 9999;
  google.y = 9999;
  google.setImage("google.jpg");
  dab.x = 9999;
  dab.y = 9999;
  dab.setImage("dab.png");
  song.x = 9999;
  song.y = 9999;
  song.setImage("song.jpg");
  ping.x = 9997;
  ping.y = 9997;
  ping.setImage("ping.jpg");
  tv.setImage("TV.png");
  tv.x= 9999;
  tv.y= 9999;
  XYZ = 9999;
  bomb.width=70;
  bomb.height=75;
  bomb.x=50;
  bomb.y=-900;
  bomb2.setImage("bomb.png");
  bomb2.width=70;
  bomb2.height=75;
  bomb2.x=350;
  bomb2.y=0;
  bomb3.setImage("bomb.png");
  bomb3.width=70;
  bomb3.height=75;
  bomb3.x=1700;
  bomb3.y=-3967;
  bomb4.setImage("bomb.png");
  bomb4.width=70;
  bomb4.height=75;
  bomb4.x=700;
  bomb4.y=-2700;
  bomb5.setImage("bomb.png");
  bomb5.x=1200;
  bomb5.y=-1400;
  bomb5.width=70;
  bomb5.height=75;
  bomb6.setImage("bomb.png");
  bomb6.x=520;
  bomb6.y=-5000;
  bomb6.width=70;
  bomb6.height=75;
  //exp[1] = loadImage("explode1.gif");
  //exp[2] = loadImage("explode2.gif");
  //exp[3] = loadImage("explode3.gif");
  //exp[4] = loadImage("explode4.gif");
  //exp[5] = loadImage("explode5.gif");
  //exp[6] = loadImage("explode6.gif");
  //exp[7] = loadImage("explode7.gif");
  //exp[8] = loadImage("explode8.gif");
  //exp[9] = loadImage("explode9.gif");
  //exp[10] = loadImage("explode10.gif");
  //exp[11] = loadImage("explode11.gif");
  //exp[12] = loadImage("explode12.gif");
  //exp[13] = loadImage("explode13.gif");
  //exp[14] = loadImage("explode14.gif");
  //exp[15] = loadImage("explode15.gif");
  //exp[16] = loadImage("explode16.gif");
  //exp[17] = loadImage("explode17.gif");
  //exp[18] = loadImage("explode18.gif");
  //exp[19] = loadImage("explode19.gif");
  //exp[20] = loadImage("explode20.gif");
  //exp[21] = loadImage("explode21.gif");
  //exp[22] = loadImage("explode22.gif");
  //exp[23] = loadImage("explode23.gif");
  //exp[24] = loadImage("explode24.gif");
  //exp[25] = loadImage("explode25.gif");
  //exp[26] = loadImage("explode26.gif");
  //exp[27] = loadImage("explode27.gif");
  //exp[28] = loadImage("explode28.gif");

  heart1.setImage("heart.png");
  heart2.setImage("heart.png");
  heart3.setImage("heart.png");
  heart1.width=75;
  heart1.height=75;
  heart1.x=8;
  heart1.y=15;
  heart2.width=75;
  heart2.height=75;
  heart2.x=100;
  heart2.y=15;
  heart3.width=75;
  heart3.height=75;
  heart3.x=192;
  heart3.y=15;
  gameover.setImage("game over.jpg");
  gameover.x = 9998;
  gameover.y = 9998;
  gameover.width = 1920;
  gameover.height = 1080;
  over.load("over.mp3");
  menu.setImage("menuscreen.png");
  menu.x = 0;
  menu.y = 0;
  menu.width = 1920;
  menu.height = 1080;
  exit.setImage("exit.png");
  exit.x=20;
  exit.y=990;
  exit.width=70;
  exit.height=70;
  pause.setImage("pause.png");
  pause.x = 1848;
  pause.y = 8;
  pause.width = 70;
  pause.height = 70;
  pausescreen.setImage("pausescreen.png");
  pausescreen.x = 9999;
  pausescreen.y = 9999;
  pausescreen.width = 1920;
  pausescreen.height = 1080;
  pausebackground.x = 9999;
  pausebackground.y = 9999;
  pausebackground.setImage("pausebackground.jpg");
  pausetitle.x = 9999;
  pausetitle.y = 9999;
  pausetitle.setImage("pausetitle.png");
  pausetitle.width = 340;
  pausetitle.height = 98;
  continuebutton.x = 9999;
  continuebutton.y = 9999;
  continuebutton.setImage("continue.png");
  restart.x = 9999;
  restart.y = 9999;
  restart.setImage("restart.png");
  restart.width = 580;
  restart.height = 274;
  menubutton.x = 9999;
  menubutton.y = 9999;
  menubutton.setImage("main menu.png");
  menubutton.width = 580;
  menubutton.height = 274;
  mutebutton.x = 9999;
  mutebutton.y = 9999;
  mutebutton.setImage("mutebutton.png");
  unmutebutton.x = 9999;
  unmutebutton.y = 9999;
  unmutebutton.setImage("unmutebutton.png");
  settings.setImage("settings.png");
  settings.x = 1845;
  settings.y = 8;
  settings.width = 70;
  settings.height = 70;
  settingscreen.setImage("settingscreen.jpg");
  settingscreen.x=0;
  settingscreen.y=0;
  mute.setImage("mute.png");
  mute.x=9999;
  mute.y=9999;
  mute.width=100;
  mute.height=100;
  unmute.setImage("unmute.png");
  unmute.x=9999;
  unmute.y=9999;
  unmute.width=390;
  unmute.height=195;
  white.setImage("white.png");
  white.width = 110;
  white.height = 109;
  close.x=80;
  close.y=80;
  close.width=60;
  close.height=60;
  close.setImage("close.png");
  title.setImage("title.png");
  title.x = 610;
  title.y = -80;
  title.width = 700;
  title.height = 393;


  copyright.x = 855;
  copyright.y = 1060;
  copyright.brush = color(255, 0, 0);
  copyright.alpha = 255;
  copyright.text = credit;
  copyright.textSize = 25;
  copyright.font = "Arial";
  errors.x = 9999;
  errors.y = 9999;
  errors.setImage("error.png");
  errors.x = 9999;
  errors.y = 9999;
  copyright.font = "Arial";
  play.setImage("play.png");
  play.x=825;
  play.y=420;
  play2.setImage("playwhenntouch.png");
  play2.x=9999;
  play2.y=9999;
  again.setImage("try again.png");
  again.width = 250;
  again.height = 52;
  again.x=825;
  again.y=940;
  home.setImage("home.png");
  home.x=9999;
  home.y=9999;
  home.width=70;
  home.height=70;


  if (mouseX>853 && mouseY>433 && mouseX<1048 && mouseY<515) {
    play.x=9999;
    play.y=9999;
    play2.x=825;
    play2.y=420;
  }
}


void draw() {


  google.draw();
  if (keyPressed == true) {
    google.x = 9999;
  }
  if (keyPressed == false) {
    google.x = 9998;
  }
  if (key=='d' || key=='D' && menu.x == 9999 && google.x == 9999 && google.y == 9999) {
    pirate.x = pirate.x +6;
    wave.x = pirate.x - 70;
    wave.y = 840;
  } else if (key=='a' || key =='A' && menu.x == 9999 && google.x == 9999 && google.y == 9999) {
    pirate.x = pirate.x -6;
    wave.x = pirate.x - 70;
    wave.y = 840;
  }
  if (keyCode==RIGHT && menu.x == 9999 && google.x == 9999 && google.y == 9999) {
    pirate.x = pirate.x +6;
    wave.x = pirate.x - 70;
    wave.y = 840;
  } else if (keyCode==LEFT && menu.x == 9999 && google.x == 9999 && google.y == 9999) {
    pirate.x = pirate.x -6;
    wave.x = pirate.x - 70;
    wave.y = 840;
  }
  if (gameover.x == 9999 && gameover.y == 9999 || gameover.x == 9998 && gameover.y == 9998) {
    home.x = 9999;
  }


  ping.draw(); //read to 3rd line to see what ping mean.
  if (cube.x == 9999 && cube.y == 9999) {
    play.x = 9999;
    play.y = 9999;
    play2.x = 9999;
    play2.y = 9999;
  }
  errors.draw();

  settingscreen.draw();
  settingscreen.x=5;
  settingscreen.y=9999;
  white.draw();
  white.x=9999;
  white.y=1;
  close.draw();
  // if (exit.x == 20 && exit.y == 990  && (mouseButton == LEFT)
  if (menu.x == 9999 && menu.y == 9999 && settingscreen.y == 9999 && ping.x == 9998 && ping.y == 9998) {
    exit.x=9999;
    exit.y=9999;
    play2.x=9999;
    play2.y=9999;
    play.x=9999;
    play.y=9999;
  }
  if (ping.x == 9998 && ping.y == 9998) {
    background.draw();
    pirate.draw();
    bomb.draw();
    bomb2.draw();
    bomb3.draw();
    bomb4.draw();
    bomb5.draw();
    bomb6.draw();
    heart1.draw();
    heart2.draw();
    heart3.draw();
    pause.draw();
  }


  menu.draw();
  home.draw();
  title.draw();
  play.draw();
  play2.draw();
  settings.draw();
  copyright.draw();
  mute.draw();
  unmute.draw();
  exit.draw();
  wave.draw();
  if (pirate.speed == 0) {
    wave.x = 9999;
    wave.y = 9999;
  }

  if (mousePressed && (mouseButton == LEFT) && mouseX>1857 && mouseY>3 && mouseX<1937 && mouseY<83 && settings.x == 1845 && close.x>79 && close.y>2) {
    menu.x = 9998;
    menu.y = 9999;
    play.x = 9999;
    play.y = 9999;
    title.x = 9999;
    title.y = 9999;
    copyright.x = 9999;
    copyright.y = 9999;
    settings.x=9999;
    settings.y=9999;
    mouseX = 1000;
    mouseY = 1000;
    play2.x=9999;
    play2.y=9999;
    play.x=9999;
    play.y=9999;
    cube.x=9999;
    cube.y=9999;
    settingscreen.x=0;
    settingscreen.y=0;
    close.x=1857;
    close.y=3;
    white.x=666;
    white.y=320;
    mute.x=667;
    mute.y=323;
  }
  cube.draw(); //read the first line to see what cube mean.
  spiner.draw(); //read the 2nd line to see what spiner mean.
  dab.draw();
  song.draw();
  tv.draw();
  pausebackground.draw();
  pausescreen.draw();
  pausetitle.draw();
  continuebutton.draw();
  restart.draw();
  menubutton.draw();
  unmutebutton.draw();
  mutebutton.draw();
  if (mute.x == 667 && mute.y == 323) {
    title.x=9998;
    title.y=9998;
  }
  if (gameover.x == 0 && gameover.y == 0) { //fixing that bug that try again button not showing
    again.x=825;
    again.y=940;
    home.x=1845;
    home.y=11;
  }


  if (play.x == 9999 && play.y == 9999) {
    play.x = 9998;
    play.y = 9998;
  }
  if (title.x == 9998 && title.y == 9998 && (mousePressed) && (mouseButton == LEFT) && mouseX>1857 && mouseY>3 && mouseX<1937 && mouseY<83 && close.x==1857 && close.y==3) {
    unmute.x=9999;
    unmute.y=9999;
    mute.x=9999;
    mute.y=9999;
    settingscreen.x=9999;
    settingscreen.y=9999;
    white.x=9999;
    white.y=9999;
    menu.x=0;
    menu.y=0;
    title.x = 610;
    title.y = -80;
    play.x=825;
    play.y=420;
    settings.x = 1845;
    settings.y = 11;
    copyright.x = 855;
    copyright.y = 1060;
    mouseX = 1000;
    mouseY = 1000;
    play2.x=9999;
    play2.y=9999;
    cube.x = 9998;
    cube.y = 9998;
  }
  if (mute.x == 667 && mute.y == 323 && white.x == 666 && white.y == 320 && title.x == 9998 && title.y == 9998 && (mousePressed) && (mouseButton == LEFT) && mouseX>1857 && mouseY>3 && mouseX<1937 && mouseY<83 && close.x==1857 && close.y==3) {
    if (mousePressed && (mouseButton == LEFT) && mouseX>1857 && mouseY>3 && mouseX<1937 && mouseY<83 && settings.x == 1845 && close.x>79 && close.y>2) {
      mute.x=9999;
      mute.y=9999;
      settingscreen.x=0;
      settingscreen.y=0;
      white.x=666;
      white.y=320;
      unmute.x=530;
      unmute.y=275;
      mouseX = 50;
      mouseY = 50;
      play2.x=9999;
      play2.y=9999;
      cube.x = 9999;
    }
  }

  //&& mouseX>675 && mouseY>320 && mouseX<775 && mouseY<420 && settings.x == 1840){
  if (mousePressed && (mouseButton == LEFT) && mouseX>530 && mouseY>275 && mouseX<920 && mouseY<470 && mute.x == 667 && mute.y == 323) { 
    mute.x=9999;
    mute.y=9999;
    settingscreen.x=0;
    settingscreen.y=0;
    white.x=666;
    white.y=320;
    soundtrack.setGain(-100);
    unmute.x=530;
    unmute.y=275;
    play2.x=9999;
    play2.y=9999;
    mouseX = 50;
    mouseY = 50;
    cube.x = 9999;
    cube.y = 9999;
    tv.x = 9998;
    tv.y = 9998;
  }
  if (mousePressed && (mouseButton == LEFT) && mouseX>530 && mouseY>275 && mouseX<920 && mouseY<470 && unmute.x == 530 && unmute.y == 275 && mute.x == 9999 && mute.y == 9999) {
    unmute.x=9999;
    unmute.y=9999;
    settingscreen.x=0;
    settingscreen.y=0;
    white.x=666;
    white.y=320;
    play2.x=9999;
    play2.y=9999;
    soundtrack.setGain(+1);
    mute.x=667;
    mute.y=323;
    mouseX = 50;
    mouseY = 50;
    cube.x = 9999;
    cube.y = 9999;
    tv.x = 9999;
    tv.y = 9999;
  }
  if (mouseX>853 && mouseY>433 && mouseX<1048 && mouseY<515 && menu.x==0 && menu.y==0) {
    play.x=9999;
    play.y=9999;
    play2.x=825;
    play2.y=420;
  }
  if (mouseX<850 && mouseY<435 || mouseX>1043 && mouseY<440 || mouseX<855 && mouseY>514 || mouseX>1049 && mouseY>516 && menu.x==0 && menu.y==0 && settingscreen.x == 9999) {
    play2.x=9999;
    play2.y=9999;
    play.x=825;
    play.y=420;
  }


  //mouse x> 1029 mouse y>1028  mousex<1010
  if (mousePressed && (mouseButton == LEFT) && mouseX>853 && mouseY>433 && mouseX<1048 && mouseY<515 && play2.x == 825 && play2.y == 420 && ping.x == 9997 && ping.y == 9997) {
    ping.x = 9998;
    ping.y = 9998;
    menu.x = 9999;
    menu.y = 9999;
    play.x = 9999;
    play.y = 9999;
    title.x = 9999;
    title.y = 9999;
    copyright.x = 9999;
    copyright.y = 9999;
    settings.x = 9999;
    settings.y = 9999;
  }



  if (pirate.x>1920) {
    pirate.x=0;
  }
  if (pirate.x<0) {
    pirate.x=1920;
  }
  if (pausescreen.x == 9999 && pausescreen.y == 9999) {
    bomb.direction=Direction.DOWN;
    bomb.speed = 11;
    bomb2.direction=Direction.DOWN;
    bomb2.speed = 11;
    bomb3.direction=Direction.DOWN;
    bomb3.speed = 11;
    bomb4.direction=Direction.DOWN;
    bomb4.speed = 11;
    bomb5.direction=Direction.DOWN;
    bomb5.speed = 11;
    bomb6.direction=Direction.DOWN;
    bomb6.speed = 11;
  }
  if (pausescreen.x == 0 && pausescreen.y == 0 || gameover.x == 9999 && gameover.y == 9999) {
    bomb.speed = 0;
    bomb2.speed = 0;
    bomb3.speed = 0;
    bomb4.speed = 0;
    bomb5.speed = 0;
    bomb6.speed = 0;
  }
  //-500,+700,+1,+80

  if (bomb2.y>1080) {
    bomb2.x=int(random(1, 920));
    bomb2.y= 0;
    success.play();
    score = score + 1;
  }

  if (bomb4.y>1080) {
    bomb4.x=int(random(1, 1920));
    bomb4.y =0;
    success.play();
    score = score + 1;
  }

  if (bomb6.y>1080) {
    bomb6.x=int(random(1, 1920));
    bomb6.y =0;
    success.play();
    score = score + 1;
  }

  if (pirate.pointInShape(bomb.x, bomb.y) && heart2.y == 9999 && heart3.y == 9999 && pausescreen.x == 9999 && pausescreen.y == 9999) {
    heart1.x=9999;
    heart1.y=9999;
    text("score: "+ score, 15, 1057);
    soundtrack.pause();
    pirate.x=1920;
    pirate.y=9999;
    heart1.x=9999;
    heart1.y=9999;
    background.x=9999;
    background.y=9999;
    gameover.x=0;
    gameover.y=0;
    gameover.draw();
    again.draw();
    home.draw();
    home.x=1845;
    home.y=11;
    again.x=825;
    again.y=940;
    home.x=1845;
    home.y=11;
    over.play();
    heart1.height=85;
    exit.x=20;
    exit.y=990;
  }
  if (pirate.pointInShape(bomb2.x, bomb2.y) && heart2.y == 9999 && heart3.y == 9999 && pausescreen.x == 9999 && pausescreen.y == 9999) {
    heart1.x=9999;
    heart1.y=9999;
    text("score: "+ score, 15, 1057);
    soundtrack.pause();
    pirate.x=1920;
    pirate.y=9999;
    heart1.x=9999;
    heart1.y=9999;
    background.x=9999;
    background.y=9999;
    gameover.x=0;
    gameover.y=0;
    gameover.draw();
    again.draw();
    home.draw();
    again.x=825;
    again.y=940;
    home.x=1845;
    home.y=11;
    home.x=1845;
    home.y=11;
    over.play();
    heart1.height=85;
    exit.x=20;
    exit.y=990;
  }
  if (pirate.pointInShape(bomb3.x, bomb3.y) && heart2.y == 9999 && heart3.y == 9999 && pausescreen.x == 9999 && pausescreen.y == 9999) {
    heart1.x=9999;
    heart1.y=9999;
    text("score: "+ score, 15, 1057);
    soundtrack.pause();
    pirate.x=1920;
    pirate.y=9999;
    heart1.x=9999;
    heart1.y=9999;
    background.x=9999;
    background.y=9999;
    gameover.x=0;
    gameover.y=0;
    gameover.draw();
    again.draw();
    home.draw();
    home.x=1845;
    home.y=11;
    over.play();
    heart1.height=85;
    exit.x=20;
    exit.y=990;
  }
  if (pirate.pointInShape(bomb4.x, bomb4.y) && heart2.y == 9999 && heart3.y == 9999 && pausescreen.x == 9999 && pausescreen.y == 9999) {
    heart1.x=9999;
    heart1.y=9999;
    text("score: "+ score, 15, 1057);
    soundtrack.pause();
    pirate.x=1920;
    pirate.y=9999;
    heart1.x=9999;
    heart1.y=9999;
    background.x=9999;
    background.y=9999;
    gameover.x=0;
    gameover.y=0;
    gameover.draw();
    again.draw();
    home.draw();
    again.x=825;
    again.y=940;
    home.x=1845;
    home.y=11;
    over.play();
    heart1.height=85;
    exit.x=20;
    exit.y=990;
  }
  if (pirate.pointInShape(bomb5.x, bomb5.y) && heart2.y == 9999 && heart3.y == 9999 && pausescreen.x == 9999 && pausescreen.y == 9999) {
    heart1.x=9999;
    heart1.y=9999;
    text("score: "+ score, 15, 1057);
    soundtrack.pause();
    pirate.x=1920;
    pirate.y=9999;
    heart1.x=9999;
    heart1.y=9999;
    background.x=9999;
    background.y=9999;
    gameover.x=0;
    gameover.y=0;
    gameover.draw();
    again.draw();
    home.draw();
    again.x=825;
    again.y=940;
    home.x=1845;
    home.y=11;
    over.play();
    heart1.height=85;
    exit.x=20;
    exit.y=990;
  }
  if (pirate.pointInShape(bomb6.x, bomb6.y) && heart2.y == 9999 && heart3.y == 9999 && pausescreen.x == 9999 && pausescreen.y == 9999) {
    heart1.x=9999;
    heart1.y=9999;
    text("score: "+ score, 15, 1057);
    soundtrack.pause();
    pirate.x=1920;
    pirate.y=9999;
    heart1.x=9999;
    heart1.y=9999;
    background.x=9999;
    background.y=9999;
    gameover.x=0;
    gameover.y=0;
    gameover.draw();
    again.draw();
    home.draw();
    again.x=825;
    again.y=940;
    home.x=1845;
    home.y=11;
    over.play();
    heart1.height=85;
    exit.x=20;
    exit.y=990;
  }

  if (pirate.pointInShape(bomb.x, bomb.y) && heart3.y == 9999 && heart1.x == 8) {
    bomb.x=int(random(1, 1920));
    bomb.y=0;
    heart2.y=9999;
    failed.play();
  }
  if (pirate.pointInShape(bomb2.x, bomb2.y) && heart3.y == 9999 && heart1.x == 8) {
    bomb2.x=int(random(1, 1920));
    bomb2.y=0;
    heart2.y=9999;
    failed.play();
  }
  if (pirate.pointInShape(bomb3.x, bomb3.y) && heart3.y == 9999 && heart1.x == 8) {
    bomb3.x=int(random(1, 1920));
    bomb3.y=0;
    heart2.y=9999;
    failed.play();
  }
  if (pirate.pointInShape(bomb4.x, bomb4.y) && heart3.y == 9999 && heart1.x == 8) {
    bomb4.x=int(random(1, 1920));
    bomb4.y=0;
    heart2.y=9999;
    failed.play();
  }
  if (pirate.pointInShape(bomb5.x, bomb5.y) && heart3.y == 9999 && heart1.x == 8) {
    bomb5.x=int(random(1, 1920));
    bomb5.y=0;
    heart2.y=9999;
    failed.play();
  }
  if (pirate.pointInShape(bomb6.x, bomb6.y) && heart3.y == 9999 && heart1.x == 8) {
    bomb6.x=int(random(1, 1920));
    bomb6.y=0;
    heart2.y=9999;
    failed.play();
  }
  if (pirate.pointInShape(bomb.x, bomb.y)) {
    bomb.x=int(random(1, 1920));
    ;
    failed.play();
    heart3.y=9999;
  }
  if (pirate.pointInShape(bomb2.x, bomb2.y)) {
    bomb2.x=int(random(1, 1920));
    bomb2.y = -10;
    failed.play();
    heart3.y=9999;
  }
  if (pirate.pointInShape(bomb3.x, bomb3.y)) {
    bomb3.x=int(random(1, 1920));
    bomb3.y=-10;
    failed.play();
    heart3.y=9999;
  }
  if (pirate.pointInShape(bomb4.x, bomb4.y)) {
    bomb4.x=int(random(1, 1920));
    bomb4.y=-10;
    failed.play();
    heart3.y=9999;
  }
  if (pirate.pointInShape(bomb5.x, bomb5.y)) {
    bomb5.x=int(random(1, 1920));
    bomb5.y=-10;
    failed.play();
    heart3.y=9999;
  }
  if (pirate.pointInShape(bomb6.x, bomb6.y)) {
    bomb6.x=int(random(1, 1920));
    bomb6.y=-10;
    failed.play();
    heart3.y=9999;
  }

  if (menu.x == 9999 && menu.y == 9999 && background.x == 0 && background.y == 0 && pausescreen.x == 9999 && pausescreen.y == 9999) {
    textSize(32);
    fill(0, 255, 0);
    text("score: "+ score, 15, 1057);
  }

  if (heart1.x == 9999 && heart1.y == 9999) {
    gameover.draw();
    again.draw();
    home.draw();
    home.x=1845;
    home.y=11;
    bomb.x =  6666;
    bomb.y =  6666;
    bomb2.x = 6666;
    bomb2.y = 6666;
    bomb3.x = 6666;
    bomb3.y = 6666;
    bomb4.x = 6666;
    bomb4.y = 6666;
    bomb5.x = 6666;
    bomb5.y = 6666;
    bomb6.x = 6666;
    bomb6.y = 6666;
  }



  if (mousePressed && (mouseButton == LEFT) && mouseX>825 && mouseY>940 && mouseX<1075 && mouseY<992 && gameover.x == 0 && gameover.y == 0) {
    menu.x = 9999;
    menu.y = 9999;
    gameover.x = 9998;
    gameover.y = 9998;
    home.x = 9999;
    home.y = 9999;
    background.x=0;
    background.y=0;
    soundtrack.play();
    pirate.x=855;
    pirate.y=770;
    bomb.x=int(random(1, 1800));
    bomb.y=-900;
    bomb2.x=int(random(1, 1800));
    bomb2.y=-80;
    bomb3.x=int(random(1, 1800));
    bomb3.y=-450;
    bomb4.x=int(random(1, 1800));
    bomb4.y=-610;
    bomb5.x=int(random(1, 1800));
    bomb5.y=-1400;
    bomb6.x=int(random(1, 1800));
    bomb6.y=-2000;
    heart1.width=75;
    heart1.height=75;
    heart1.x=8;
    heart1.y=15;
    heart2.width=75;
    heart2.height=75;
    heart2.x=100;
    heart2.y=15;
    heart3.width=75;
    heart3.height=75;
    heart3.x=192;
    heart3.y=15;
    score = score - score;
  }
  //if the player has 1366x768 display
  if (displayWidth == 1366 && displayHeight == 768) {
    if (errors.x == 9999 && errors.y == 9999) {
      white.width = 1366;
      white.height = 768;
      white.x = 0;
      errors.x = 250;
      errors.y = 200;
      soundtrack.setGain(-80);
      menu.x = 9999;
      menu.y = 9999;
      play.x = 9999;
      play.y = 9999;
      pirate.x = 9999;
      pirate.y = 9999;
      background.x = 9999;
      background.y = 9999;
      bomb.x = 9999;
      bomb.y = 9999;
      bomb2.x = 9999;
      bomb2.y = 9999;
      bomb3.x = 9999;
      bomb3.y = 9999;
      bomb4.x = 9999;
      bomb4.y = 9999;
      bomb5.x = 9999;
      bomb5.y = 9999;
      bomb6.x = 9999;
      bomb6.y = 9999;
      heart1.x = 9999;
      heart2.x = 9999;
      heart2.y = 9999;
      heart3.x = 9999;
      heart3.y = 9999;
      close.x = 9999;
      close.y = 9999;
      title.x = 9999;
      title.y = 9999;
      //errors.x =
      //   settingscreen.width = 1366;
      //  settingscreen.height = 768;
      //  menu.width = 1366;
      //  menu.height = 768;
      //  bomb.direction=Direction.DOWN;
      //bomb.speed = 22;
      //    bomb2.direction=Direction.DOWN;
      //    bomb2.speed = 22;
      //   bomb3.direction=Direction.DOWN;
      //    bomb3.speed = 22;
      //    bomb4.direction=Direction.DOWN;
      //    bomb4.speed = 22;
      //    background.width = 1366;
      //    background.height = 768;
      //    text("score: "+ score, 1226, 30);
      //    pirate.y = 458;
      //    pirate.width = 120;
      //   pirate.height = 129;
      //   bomb.width = 60;
      //   bomb.height = 65;
      //   bomb2.width = 60;
      // bomb2.height = 65;
      //    bomb3.width = 60;
      //   bomb3.height = 65;
      //    bomb4.width = 60;
      //   bomb4.height = 65;
      //    gameover.width = 1366;
      //  gameover.height = 768;
      //  again.x = 550; 
      // again.y = 650;
      //  }
      //if (mousePressed && (mouseButton == LEFT) && mouseX>550 && mouseY>650 && mouseX<800 && mouseY<900 && again.x == 550 && again.y == 650 && displayWidth == 1366 && displayHeight == 768) {
      //    gameover.x = 9999;
      //   gameover.y = 9999;
      //    background.x=0;
      //   background.y=0;
      //    soundtrack.play();
      //    pirate.x=855;
      //    pirate.y=770;
      // heart1.width=75;
      //   heart1.height=75;
      //   heart1.x=8;
      //    heart1.y=15;
      //    heart2.width=75;
      //    heart2.height=75;
      //    heart2.x=100;
      //    heart2.y=15;
      //    heart3.width=75;
      //   heart3.height=75;
      //    heart3.x=192;
      //   heart3.y=15;
      //   score = score - score;
      //   text("score: "+ score, 9999, 9999);
      // }
      // if (bomb.y>768 && displayWidth == 1366 && displayHeight == 768) {
      //    bomb.x=int(random(1, 1920));
      //   bomb.y= 0;
      //   success.play();
      //    score = score + 1;
      //  }
      //  if (bomb2.y>768 && displayWidth == 1366 && displayHeight == 768) {
      //   bomb2.x=int(random(1, 920));
      //    bomb2.y= 0;
      //    success.play();
      //    score = score + 1;
      //  }
      //  if (bomb3.y>768 && displayWidth == 1366 && displayHeight == 768) {
      //   bomb3.x=int(random(1, 1920));
      //    bomb3.y= 0;
      //   success.play();
      //    score = score + 1;
      //  }


      //   if (bomb4.y>768 && displayWidth == 1366 && displayHeight == 768) {
      //   bomb4.x=int(random(1, 1920));
      //    bomb4.y= 0;
      //    success.play();
      //    score = score + 1;
    }
    home.draw();
  }
}


Continue:

void mouseReleased() {
  if (background.x == 0 && background.y == 0 && heart1.x == 8 && heart1.y == 15) {
    google.x = 9998;
    google.y = 9998;
  }
  if (exit.x == 20 && exit.y == 990 && (mouseButton == LEFT) && mouseX>35 && mouseY>985 && mouseX<76 && mouseY<1042) {
    exit();
  }
  if (tv.x == 9999 && tv.y == 9999 && pausescreen.x == 0 && pausescreen.y == 0 && pausebackground.x == 0 && pausebackground.y == 0) {
    mutebutton.x = 750;
    mutebutton.y = 750;
  }
  if (tv.x == 9998 && tv.y == 9998 && pausescreen.x == 0 && pausescreen.y == 0 && pausebackground.x == 0 && pausebackground.y == 0) {
    unmutebutton.x = 750;
    unmutebutton.y = 750;
  }
  if (pause.x == 1848 && pause.y == 8 && background.x == 0 && background.y == 0 && (mouseButton == LEFT) && mouseX>1856 && mouseY>5 && mouseX<1902 && mouseY<70 && title.x == 9999 && title.y == 9999) {
    gameover.x = 9998;
    background.x = 9999;
    background.y = 9999;
    pausebackground.x = 0;
    pausebackground.y = 0;
    pausescreen.x = 0;
    pausescreen.y = 0;
    pausetitle.x = 815;
    pausetitle.y = 269;
    continuebutton.x = 690;
    continuebutton.y = 320;
    restart.x = 690;
    restart.y = 450;
    menubutton.x = 670;
    menubutton.y = 555;
  }

  if (pausescreen.x == 0 && pausescreen.y == 0 && pausebackground.x == 0 && pausebackground.y == 0 && (mouseButton == LEFT) && mouseX>758 && mouseY>397 && mouseX<1186 && mouseY<503) {
    pausebackground.x = 9999;
    pausebackground.y = 9999;
    background.x = 0;
    background.y = 0;
    pausescreen.x = 9999;
    pausescreen.y = 9999;
    pausetitle.x = 9999;
    pausetitle.y = 9999;
    continuebutton.x = 9999;
    continuebutton.y = 9999;
    restart.x = 9999;
    restart.y = 9999;
    menubutton.x = 9999;
    menubutton.y = 9999;
    mutebutton.x = 9999;
    mutebutton.y = 9999;
    unmutebutton.x = 9999;
    unmutebutton.y = 9999;
  }
  if (pausescreen.x == 0 && pausescreen.y == 0 && pausebackground.x == 0 && pausebackground.y == 0 && (mouseButton == LEFT) && mouseX>778 && mouseY>528 && mouseX<1192 && mouseY<618) {
    pausebackground.x = 9999;
    pausebackground.y = 9999;
    background.x = 0;
    background.y = 0;
    pausescreen.x = 9999;
    pausescreen.y = 9999;
    pausetitle.x = 9999;
    pausetitle.y = 9999;
    continuebutton.x = 9999;
    continuebutton.y = 9999;
    restart.x = 9999;
    restart.y = 9999;
    menubutton.x = 9999;
    menubutton.y = 9999;
    mutebutton.x = 9999;
    mutebutton.y = 9999;
    unmutebutton.x = 9999;
    unmutebutton.y = 9999;
    heart1.width=75;
    heart1.height=75;
    heart1.x=8;
    heart1.y=15;
    heart2.width=75;
    heart2.height=75;
    heart2.x=100;
    heart2.y=15;
    heart3.width=75;
    heart3.height=75;
    heart3.x=192;
    heart3.y=15;
    pirate.width=180;
    pirate.height=193;
    pirate.x=855;
    pirate.y=740;
    bomb.width=70;
    bomb.height=75;
    bomb.x=50;
    bomb.y=-900;
    bomb2.setImage("bomb.png");
    bomb2.width=70;
    bomb2.height=75;
    bomb2.x=350;
    bomb2.y=-80;
    bomb3.setImage("bomb.png");
    bomb3.width=70;
    bomb3.height=75;
    bomb3.x=1700;
    bomb3.y=-450;
    bomb4.setImage("bomb.png");
    bomb4.width=70;
    bomb4.height=75;
    bomb4.x=700;
    bomb4.y=-2700;
    bomb5.setImage("bomb.png");
    bomb5.x=1200;
    bomb5.y=-1400;
    bomb5.width=70;
    bomb5.height=75;
    bomb6.setImage("bomb.png");
    bomb6.x=520;
    bomb6.y=-2000;
    bomb6.width=70;
    bomb6.height=75;
    score = score - score;
  }
  if (pausescreen.x == 0 && pausescreen.y == 0 && pausebackground.x == 0 && pausebackground.y == 0 && (mouseButton == LEFT) && mouseX>779 && mouseY>640 && mouseX<1196 && mouseY<738) {
    pausebackground.x = 9999;
    pausebackground.y = 9999;
    menu.x = 0;
    menu.y = 0;
    pausescreen.x = 9999;
    pausescreen.y = 9999;
    pausetitle.x = 9999;
    pausetitle.y = 9999;
    continuebutton.x = 9999;
    continuebutton.y = 9999;
    restart.x = 9999;
    restart.y = 9999;
    menubutton.x = 9999;
    menubutton.y = 9999;
    mutebutton.x = 9999;
    mutebutton.y = 9999;
    unmutebutton.x = 9999;
    unmutebutton.y = 9999;
    title.x = 610;
    title.y = -80;
    play.x=825;
    play.y=420;
    settings.x = 1845;
    settings.y = 8;
    copyright.x = 855;
    copyright.y = 1060;
    exit.x=20;
    exit.y=990;
    ping.x = 9998;
    ping.y = 9998;
    play2.x = 825;
    play2.y = 420;  
    ping.x = 9997; 
    ping.y = 9997;
    dab.x = 9998; 
    dab.y = 9998;
    gameover.x = 9999;
    gameover.y = 9999;
    if (mousePressed && (mouseButton == LEFT) && mouseX>853 && mouseY>433 && mouseX<1048 && mouseY<515 && play2.x == 825 && play2.y == 420 && ping.x == 9998 && ping.y == 9998 && dab.x == 9998 && dab.y == 9998) {
      score = score - score;
      menu.x = 9999;
      menu.y = 9999;
      play.x = 9999;
      play.y = 9999;
      play2.x = 9999;
      play2.y = 9999;
      title.x = 9999;
      title.y = 9999;
      copyright.x = 9999;
      copyright.y = 9999;
      settings.x = 9999;
      settings.y = 9999;
      background.x=0;
      background.y=0;
      bomb.x=50;
      bomb.y=-900;
      bomb2.x=350;
      bomb2.y=-80;
      bomb3.x=1700;
      bomb3.y=-450;
      bomb4.x=700;
      bomb4.y=-610;
      bomb5.x=1200;
      bomb5.y=-1400;
      bomb6.x=520;
      bomb6.y=-2000;
      heart1.x=8;
      heart1.y=15;
      heart2.x=100;
      heart2.y=15;
      heart3.x=192;
      heart3.y=15;
      ping.x = 9998;
      ping.y = 9998;
      settingscreen.x = 9999;
      settingscreen.y = 9999; 
      ping.x = 9999;
      ping.y = 9999;
    }
  }


  if (pausescreen.x == 0 && pausescreen.y == 0 && pausebackground.x == 0 && pausebackground.y == 0 && (mouseButton == LEFT) && mouseX>915 && mouseY>793 && mouseX<987 && mouseY<880 && tv.x == 9999 && tv.y == 9999) {
    soundtrack.setGain(-100);
    tv.x = 9998;
    tv.y = 9998;
    mutebutton.x = 9999;
    mutebutton.y = 9999;
    unmutebutton.x = 750;
    unmutebutton.y = 750;
    mouseX = 100;
    mouseY = 100;
  }
  if (pausescreen.x == 0 && pausescreen.y == 0 && pausebackground.x == 0 && pausebackground.y == 0 && (mouseButton == LEFT) && mouseX>915 && mouseY>793 && mouseX<987 && mouseY<880 && tv.x == 9998 && tv.y == 9998) {
    soundtrack.setGain(+100);
    tv.x = 9999;
    tv.y = 9999;
    unmutebutton.x = 9999;
    unmutebutton.y = 9999;
    mutebutton.x = 750;
    mutebutton.y = 750;
    mouseX = 100;
    mouseY = 100;
  }
  if (home.x == 1845 && home.y == 11 && (mouseButton == LEFT) && mouseX>1827 && mouseY>8 && mouseX<1910 && mouseY<70 && gameover.x == 0 && gameover.y == 0) {
    dab.x = 9998;
    dab.y = 9998;
    gameover.x = 9999;
    gameover.y = 9999;
    spiner.x = 9999;
    spiner.y = 9999;
    home.x = 9999;
    home.y = 9999;
    again.x = 9999;
    again.y = 9999;
    menu.x = 0;
    menu.y = 0;
    settings.x = 1845;
    settings.y = 11;
    title.x = 800;
    title.y = 110;
    copyright.x = 855;
    copyright.y = 1060;
    soundtrack.pause();
    exit.x=20;
    exit.y=990;
    play.x = 825;
    play.y = 420;
    ping.x = 9997;
    ping.y = 9997;
    minim=new Minim(this);
    soundtrack=minim.loadFile("soundtrack.mp3");
    soundtrack.loop();
    success.load("success.mp3");
    failed.load("failed.mp3");
    pirate.setImage("pirate ship.png");
    pirate.width=180;
    pirate.height=193;
    pirate.x=855;
    pirate.y=740;
    bomb.setImage("bomb.png");
    cube.setImage("cube.jpg");
    timeLeft = 3;
    XYZ = 9999;
    //exp[1] = loadImage("explode1.gif");
    //exp[2] = loadImage("explode2.gif");
    //exp[3] = loadImage("explode3.gif");
    //exp[4] = loadImage("explode4.gif");
    //exp[5] = loadImage("explode5.gif");
    //exp[6] = loadImage("explode6.gif");
    //exp[7] = loadImage("explode7.gif");
    //exp[8] = loadImage("explode8.gif");
    //exp[9] = loadImage("explode9.gif");
    //exp[10] = loadImage("explode10.gif");
    //exp[11] = loadImage("explode11.gif");
    //exp[12] = loadImage("explode12.gif");
    //exp[13] = loadImage("explode13.gif");
    //exp[14] = loadImage("explode14.gif");
    //exp[15] = loadImage("explode15.gif");
    //exp[16] = loadImage("explode16.gif");
    //exp[17] = loadImage("explode17.gif");
    //exp[18] = loadImage("explode18.gif");
    //exp[19] = loadImage("explode19.gif");
    //exp[20] = loadImage("explode20.gif");
    //exp[21] = loadImage("explode21.gif");
    //exp[22] = loadImage("explode22.gif");
    //exp[23] = loadImage("explode23.gif");
    //exp[24] = loadImage("explode24.gif");
    //exp[25] = loadImage("explode25.gif");
    //exp[26] = loadImage("explode26.gif");
    //exp[27] = loadImage("explode27.gif");
    //exp[28] = loadImage("explode28.gif");


    over.load("over.mp3");
    menu.setImage("menuscreen.png");
    menu.x = 0;
    menu.y = 0;
    menu.width = 1920;
    menu.height = 1080;
    exit.setImage("exit.png");
    exit.x=20;
    exit.y=990;
    exit.width=70;
    exit.height=70;
    settingscreen.setImage("settingscreen.jpg");
    mute.setImage("mute.png");
    mute.x=9999;
    mute.y=9999;
    mute.width=100;
    mute.height=100;
    unmute.setImage("unmute.png");
    unmute.x=9999;
    unmute.y=9999;
    unmute.width=390;
    unmute.height=195;
    white.setImage("white.png");
    white.width = 110;
    white.height = 109;
    title.setImage("title.png");
    title.x = 610;
    title.y = -80;
    title.width = 700;
    title.height = 393;


    copyright.x = 855;
    copyright.y = 1060;
    copyright.brush = color(255, 0, 0);
    copyright.alpha = 255;
    copyright.text = credit;
    copyright.textSize = 25;
    copyright.font = "Arial";
    errors.x = 9999;
    errors.y = 9999;
    errors.setImage("error.png");
    errors.x = 9999;
    errors.y = 9999;
    copyright.font = "Arial";
    play.setImage("play.png");
    play.x=825;
    play.y=420;
    play2.setImage("playwhenntouch.png");
    play2.x=9999;
    play2.y=9999;
  }
  if (mouseX>853 && mouseY>433 && mouseX<1048 && mouseY<515 && dab.x == 9998 && dab.y == 9998 && menu.x == 0 && menu.y == 0) {
    play.x=9999;
    play.y=9999;
    play2.x=825;
    play2.y=420;
  }

  if (mute.x == 667 && mute.y == 323 && white.x == 666 && white.y == 320 && title.x == 9998 && title.y == 9998  && (mouseButton == LEFT) && mouseX>1857 && mouseY>3 && mouseX<1937 && mouseY<83 && close.x==1857 && close.y==3 && dab.x == 9998 && dab.y == 9998) {
    if ((mouseButton == LEFT) && mouseX>1857 && mouseY>3 && mouseX<1937 && mouseY<83 && settings.x == 1845 && close.x>79 && close.y>2 && dab.x == 9998 && dab.y == 9998) {
      mute.x=9999;
      mute.y=9999;
      play.x = 900;
      play.y = 500;
      settingscreen.x=0;
      settingscreen.y=0;
      white.x=666;
      white.y=320;
      unmute.x=530;
      unmute.y=275;
      cube.x = 9999;
      cube.y = 9999;
      mouseX = 50;
      mouseY = 50;
      play2.x=9999;
      play2.y=9999;
    }
  }
  if (mouseX<850 && mouseY<435 || mouseX>1043 && mouseY<440 || mouseX<855 && mouseY>514 || mouseX>1049 && mouseY>516 && menu.x==0 && menu.y==0 && settingscreen.x == 9999 && dab.x == 9998 && dab.y == 9998) {
    play2.x=9999;
    play2.y=9999;
    play.x=825;
    play.y=420;
  }
  if (mouseX>853 && mouseY>433 && mouseX<1048 && mouseY<515 && menu.x==0 && menu.y==0 && dab.x == 9998 && dab.y == 9998) {
    play.x=9999;
    play.y=9999;
    play2.x=825;
    play2.y=420;
  }
  // ((mouseButton == LEFT) && mouseX>853 && mouseY>433 && mouseX<1048 && mouseY<515 && play2.x == 825 && play2.y == 420) {
  //ay.x = 950;
  //ay.y = 870;
  //}
  if (mousePressed && (mouseButton == LEFT) && mouseX>853 && mouseY>433 && mouseX<1048 && mouseY<515 && play2.x == 825 && play2.y == 420 && ping.x == 9997 && ping.y == 9997 && dab.x == 9998 && dab.y == 9998 && google.x == 9999 && google.y == 9999 && gameover.x == 9999) {
    score = score - score;
    menu.x = 9999;
    menu.y = 9999;
    play.x = 9999;
    play.y = 9999;
    play2.x = 9999;
    play2.y = 9999;
    title.x = 9999;
    title.y = 9999;
    copyright.x = 9999;
    copyright.y = 9999;
    settings.x = 9999;
    settings.y = 9999;
    background.x=0;
    background.y=0;
    bomb.x=50;
    bomb.y=-900;
    bomb2.x=350;
    bomb2.y=-80;
    bomb3.x=1700;
    bomb3.y=-450;
    bomb4.x=700;
    bomb4.y=-610;
    bomb5.x=1200;
    bomb5.y=-1400;
    bomb6.x=520;
    bomb6.y=-2000;
    heart1.x=8;
    heart1.y=15;
    heart2.x=100;
    heart2.y=15;
    heart3.x=192;
    heart3.y=15;
    ping.x = 9998;
    ping.y = 9998;
    settingscreen.x = 9999;
    settingscreen.y = 9999; 
    ping.x = 9999;
    ping.y = 9999;
  }


  if (heart1.x == 9999 && gameover.x == 0 && gameover.y == 0 && dab.x == 9998 && dab.y == 9998) {
    again.x=825;
    again.y=940;
    home.x=1845;
    home.y=11;
    gameover.x = 9999;
  }
  if (ping.x == 9998 && ping.y == 9998 && dab.x == 9998 && dab.y == 9998) {
    song.x = 9998;
  }
  if (song.x == 9998 && ping.x == 9998 && ping.y == 9998 && mouseX>853 && mouseY>453 && mouseX<1048 && mouseY<518 && google.x == 9998 && google.y == 9998 && gameover.x == 9999 && gameover.y == 9999) {

    gameover.x = 9998;
    gameover.y = 9998;
    score = score - score;
    google.x = 9999;
    google.y = 9999;
    play.x = 9999;
    play.y = 9999;
    play2.x = 9999;
    play2.y = 9999;
    title.x = 9999;
    title.y = 9999;
    copyright.x = 9999;
    copyright.y = 9999;
    settings.x = 9999;
    settings.y = 9999;
    background.x=0;
    background.y=0;
    bomb.x=50;
    bomb.y=-900;
    bomb2.x=350;
    bomb2.y=-80;
    bomb3.x=1700;
    bomb3.y=-450;
    bomb4.x=700;
    bomb4.y=-610;
    bomb5.x=1200;
    bomb5.y=-1400;
    bomb6.x=520;
    bomb6.y=-2000;
    heart1.x=8;
    heart1.y=15;
    heart2.x=100;
    heart2.y=15;
    heart3.x=192;
    heart3.y=15;
    ping.x = 9998;
    ping.y = 9998;
    settingscreen.x = 9999;
    settingscreen.y = 9999;
  }
}


void keyPressed() {
  if (key=='d' || key=='D' && menu.x == 9999) {
    google.x = 9999;
    google.y = 9999;
  } else if (key=='a' || key =='A' && menu.x == 9999) {
    google.x = 9999;
    google.y = 9999;
  }
  if (keyCode==RIGHT && menu.x == 9999) {
    google.x = 9999;
    google.y = 9999;
  } else if (keyCode==LEFT && menu.x == 9999) {
    google.x = 9999;
    google.y = 9999;
    //size(displayWidth, displayHeight);
  }
  if (key== ESC && background.x == 0 &&   pause.x == 1848 && pause.y == 8 && menu.x == 9999 && menu.y == 9999) {
    key = 0;
    gameover.x = 9998;
    background.x = 9999;
    background.y = 9999;
    pausebackground.x = 0;
    pausebackground.y = 0;
    pausescreen.x = 0;
    pausescreen.y = 0;
    pausetitle.x = 815;
    pausetitle.y = 269;
    continuebutton.x = 690;
    continuebutton.y = 320;
    restart.x = 690;
    restart.y = 450;
    menubutton.x = 670;
    menubutton.y = 555;
  }
  if (key == ESC && background.x == 9999 && background.y == 9999 && pausebackground.x == 0 && pausebackground.y == 0) {
    key = 0;
    pausebackground.x = 9999;
    pausebackground.y = 9999;
    background.x = 0;
    background.y = 0;
    pausescreen.x = 9999;
    pausescreen.y = 9999;
    pausetitle.x = 9999;
    pausetitle.y = 9999;
    continuebutton.x = 9999;
    continuebutton.y = 9999;
    restart.x = 9999;
    restart.y = 9999;
    menubutton.x = 9999;
    menubutton.y = 9999;
    mutebutton.x = 9999;
    mutebutton.y = 9999;
    unmutebutton.x = 9999;
    unmutebutton.y = 9999;
  }
}

nitz1D (another file helps me):

/********************************************/
/********************************************/
/***  NITZ Version 1.02                   ***/
/********************************************/
/********************************************/



/********************************************/
/***  Class BaseShape                     ***/
/********************************************/
abstract class BaseShape {
  public float rotation = 0;
  abstract protected int getX();
  abstract protected int getY();
  private float speedX = 0;
  private float speedY = 0;
  public int speed = 0;
  public int direction;

  protected int advanceSpeedX() {
    int advanceX = 0;
    if (speed == 0) {
      speedX = 0;
    } else {
      speedX += (speed) * cos(radians(direction));

      advanceX = round(speedX);

      speedX = speedX - advanceX;
    }
    return advanceX;
  }
  protected int advanceSpeedY() {
    int advanceY = 0;
    if (speed == 0) {
      speedY = 0;
    } else {
      speedY += (speed) * sin(radians(direction));

      advanceY = round(speedY);

      speedY = speedY - advanceY;
    }
    return advanceY;
  }
  protected void rotateIt() {
    pushMatrix();
    translate(getX(), getY());
    rotate(radians(rotation));
    translate(-getX(), -getY());
    this.drawIt();
    popMatrix();
  }
  abstract protected void drawIt();
  public void draw() {
    if (abs(rotation)%360!=0) {
      this.rotateIt();
    } else {
      this.drawIt();
    }
  }
}

/********************************************/
/***  Class Direction                     ***/
/********************************************/
class Direction {
  public final static int UP = 270;
  public final static int DOWN = 90;
  public final static int LEFT = 180;
  public final static int RIGHT = 0;
  public final static int UPRIGHT = 315;
  public final static int DOWNRIGHT = 45;
  public final static int UPLEFT = 225;
  public final static int DOWNLEFT = 135;
}


/********************************************/
/***  Class Ellipse                       ***/
/********************************************/
class Ellipse extends BaseShape {
  public int x;
  public int y;
  public int radiusX;
  public int radiusY;
  public color brush;
  public int alpha = 255;
  public color pen;
  public int penThickness;

  protected void drawIt() {
    brush = (brush & 0xffffff) | (alpha << 24);
    pen = (pen & 0xffffff) | (alpha << 24);
    fill(brush);
    if (penThickness == 0) {
      noStroke();
    } else {
      strokeWeight(penThickness);
      stroke(pen);
    }
    x += this.advanceSpeedX();
    y += this.advanceSpeedY();
    ellipse(x, y, radiusX * 2, radiusY * 2);
  }

  protected int getX() {
    return x;
  }

  protected int getY() {
    return y;
  }

  public boolean pointInShape(int x1, int y1) {
    double normalizeXPow2 = pow((x1 - x), 2);
    double normalizeYPow2 = pow((y1 - y), 2);
    double radiusXPow2 = pow(radiusX, 2);
    double radiusYPow2 = pow(radiusY, 2);
    return ((normalizeXPow2 / radiusXPow2) + (normalizeYPow2 / radiusYPow2)) <= 1.0;
  }
  public void ZoomIn() {
    x-=1;
    y-=1;
    radiusX+=2;
    radiusY+=2;
  }
  public void ZoomOut() {
    x+=1;
    y+=1;
    radiusX-=2;
    radiusY-=2;
  }
}


/********************************************/
/***  Class Hexagon                       ***/
/********************************************/
class Hexagon extends BaseShape {
  public int x;
  public int y;
  public int radius;
  public color brush;
  public int alpha = 255;
  public color pen;
  public int penThickness;
  private PVector[] verts;

  protected void drawIt() {
    brush = (brush & 0xffffff) | (alpha << 24);
    pen = (pen & 0xffffff) | (alpha << 24);
    fill(brush);
    if (penThickness == 0) {
      noStroke();
    } else {
      strokeWeight(penThickness);
      stroke(pen);
    }
    x += this.advanceSpeedX();
    y += this.advanceSpeedY();
    pushMatrix();
    polygon();
    popMatrix();
  }

  protected int getX() {
    return x;
  }

  protected int getY() {
    return y;
  }

  private void polygon() {
    verts = new PVector[7];
    float angle = 2 * PI / 6;
    beginShape();
    float sx;
    float sy;
    int index = 0;
    for (float i = 0; i < 2 * PI; i += angle) {
      sx = x + cos(i) * radius;
      sy = y + sin(i) * radius;
      verts[index++] = new PVector(sx, sy);
      vertex(sx, sy);
    }
    endShape(CLOSE);
  }
  public boolean pointInShape(int x1, int y1) {
    PVector pos = new PVector(x1, y1);
    int i, j;
    boolean c = false;
    int sides = 6;
    for (i = 0, j = sides - 1; i < sides; j = i++) {
      if ((((verts[i].y <= pos.y) && (pos.y < verts[j].y)) || ((verts[j].y <= pos.y) && (pos.y < verts[i].y))) &&
        (pos.x < (verts[j].x - verts[i].x) * (pos.y - verts[i].y) / (verts[j].y - verts[i].y) + verts[i].x)) {
        c = !c;
      }
    }
    return c;
  }
  public void ZoomIn() {
    x-=1;
    y-=1;
    radius+=2;
  }
  public void ZoomOut() {
    x+=1;
    y+=1;
    radius-=2;
  }
}

/********************************************/
/***  Class Image                          ***/
/********************************************/

class Image extends BaseShape {
  private PImage image;
  private String path;
  public int x;
  public int y;
  public int width = -1;
  public int height = -1;
  public int originalWidth = -1;
  public int originalHeight = -1;
  public float alpha = 1;

  public String getPath() {
    return path;
  }
  protected int getX() {
    return x;
  }
  protected int getY() {
    return y;
  }
  public void setImage(String path_) {
    path = path_;
    image = loadImage(path);
    if (width == -1) {
      width = image.width;
    }
    if (height == -1) {
      height = image.height;
    }
    originalWidth = width;
    originalHeight = height;
    /*
        if(width==-1){
     width = image.width;
     }
     if(height==-1){
     height = image.height;
     }
     */
  }
  public void resetSize() {
    if (image != null) {
      width = image.width;
      height = image.height;
    }
  }
  protected void drawIt() {
    x += this.advanceSpeedX();
    y += this.advanceSpeedY();

    image(image, x, y, width, height);
  }
  public boolean pointInShape(int x1, int y1) {

    if (x1 >= x && x1 <= (x + width) && y1 >= y && y1 <= (y + height)) {

      return true;
    } else {
      return false;
    }
  }
  public void ZoomIn() {
    x-=1;
    y-=1;
    width+=2;
    //height+=2;
    height = (originalHeight*width)/originalWidth;
  }
  public void ZoomOut() {
    x+=1;
    y+=1;
    width-=2;
    height = (originalHeight*width)/originalWidth;
  }
}


/********************************************/
/***  Class Line                          ***/
/********************************************/
class Line extends BaseShape {
  public int x1;
  public int y1;
  public int x2;
  public int y2;
  public int alpha = 255;
  public color pen;
  public int penThickness;

  protected void drawIt() {
    //brush = (brush & 0xffffff) | (alpha << 24);
    pen = (pen & 0xffffff) | (alpha << 24);
    if (penThickness == 0) {
      noStroke();
    } else {
      strokeWeight(penThickness);
      stroke(pen);
    }
    int advancedSpeedX = this.advanceSpeedX();
    int advancedSpeedY = this.advanceSpeedY();
    x1 += advancedSpeedX;
    y1 += advancedSpeedY;
    x2 += advancedSpeedX;
    y2 += advancedSpeedY;
    line(x1, y1, x2, y2);
  }
  protected int getX() {
    return x1;
  }
  protected int getY() {
    return y1;
  }
}


/********************************************/
/***  Class Pentagon                      ***/
/********************************************/
class Pentagon extends BaseShape {
  public int x;
  public int y;
  public int radius;
  public color brush;
  public int alpha = 255;
  public color pen;
  public int penThickness;
  private PVector[] verts;

  protected void drawIt() {
    brush = (brush & 0xffffff) | (alpha << 24);
    pen = (pen & 0xffffff) | (alpha << 24);
    fill(brush);
    if (penThickness == 0) {
      noStroke();
    } else {
      strokeWeight(penThickness);
      stroke(pen);
    }
    x += this.advanceSpeedX();
    y += this.advanceSpeedY();
    pushMatrix();
    polygon(); //(x, y, radius, 5);
    popMatrix();
  }

  protected int getX() {
    return x;
  }

  protected int getY() {
    return y;
  }

  private void polygon() {
    verts = new PVector[5];
    float angle = 2 * PI / 5;
    beginShape();
    float sx;
    float sy;
    int index = 0;
    for (float i = 0; i < 2 * PI; i += angle) {
      sx = x + cos(i) * radius;
      sy = y + sin(i) * radius;
      verts[index++] = new PVector(sx, sy);
      vertex(sx, sy);
    }
    endShape(CLOSE);
  }
  public boolean pointInShape(int x1, int y1) {
    PVector pos = new PVector(x1, y1);
    int i, j;
    boolean c = false;
    int sides = 5;

    for (i = 0, j = sides - 1; i < sides; j = i++) {
      if ((((verts[i].y <= pos.y) && (pos.y < verts[j].y)) || ((verts[j].y <= pos.y) && (pos.y < verts[i].y))) &&
        (pos.x < (verts[j].x - verts[i].x) * (pos.y - verts[i].y) / (verts[j].y - verts[i].y) + verts[i].x)) {
        c = !c;
      }
    }
    return c;
  }
  public void ZoomIn() {
    x-=1;
    y-=1;
    radius+=2;
  }
  public void ZoomOut() {
    x+=1;
    y+=1;
    radius-=2;
  }
}


/********************************************/
/***  Class Rect                          ***/
/********************************************/

class Rect extends BaseShape {
  public int x;
  public int y;
  public int width;
  public int height;
  public int originalWidth = -1;
  public int originalHeight = -1;
  public color brush;
  public int alpha = 255;
  public color pen;
  public int penThickness;

  protected void drawIt() {
    brush = (brush & 0xffffff) | (alpha << 24);
    pen = (pen & 0xffffff) | (alpha << 24);
    fill(brush);
    if (penThickness == 0) {
      noStroke();
    } else {
      strokeWeight(penThickness);
      stroke(pen);
    }

    x += this.advanceSpeedX();
    y += this.advanceSpeedY();

    rect(x, y, width, height);
  }

  protected int getX() {
    return x;
  }

  protected int getY() {
    return y;
  }

  public boolean pointInShape(int x1, int y1) {
    if (x1 >= x && x1 <= (x + width) && y1 >= y && y1 <= (y + height)) {
      return true;
    } else {
      return false;
    }
  }
  public void ZoomIn() {
    int originalWidth = width;
    int originalHeight = height;
    x-=1;
    y-=1;
    width+=2;
    height = (originalHeight*width)/originalWidth;
    //height+=2;
  }
  public void ZoomOut() {
    int originalWidth = width;
    int originalHeight = height;
    x+=1;
    y+=1;
    width-=2;
    height = (originalHeight*width)/originalWidth;
    //height -= 2;
  }
}



/********************************************/
/***  Class Text                          ***/
/********************************************/
class Text extends BaseShape {
  public int x;
  public int y;
  public color brush;
  public int alpha = 255;

  public String text;
  public int textSize;
  public String font;

  protected void drawIt() {
    brush = (brush & 0xffffff) | (alpha << 24);
    textSize(textSize);
    fill(brush);

    x += this.advanceSpeedX();
    y += this.advanceSpeedY();


    if (font!=null) {
      PFont myFont;
      myFont = createFont(font, textSize, true);
      textFont(myFont);
    }


    text(text, x, y);
  }

  protected int getX() {
    return x;
  }

  protected int getY() {
    return y;
  }
  public void ZoomIn() {
    x-=1;
    y-=1;
    textSize+=2;
  }
  public void ZoomOut() {
    x+=1;
    y+=1;
    textSize-=2;
  }
}


/********************************************/
/***  Class Triangle                      ***/
/********************************************/
class Triangle extends BaseShape {
  public int x1;
  public int y1;
  public int x2;
  public int y2;
  public int x3;
  public int y3;
  public color brush;
  public int alpha = 255;
  public color pen;
  public int penThickness;

  protected void drawIt() {
    brush = (brush & 0xffffff) | (alpha << 24);
    pen = (pen & 0xffffff) | (alpha << 24);
    fill(brush);
    if (penThickness == 0) {
      noStroke();
    } else {
      strokeWeight(penThickness);
      stroke(pen);
    }
    int advancedSpeedX = this.advanceSpeedX();
    int advancedSpeedY = this.advanceSpeedY();
    x1 += advancedSpeedX;
    y1 += advancedSpeedY;
    x2 += advancedSpeedX;
    y2 += advancedSpeedY;
    x3 += advancedSpeedX;
    y3 += advancedSpeedY;
    triangle(x1, y1, x2, y2, x3, y3);
  }
  protected int getX() {
    return x1;
  }
  protected int getY() {
    return y1;
  }
  public boolean pointInShape(int x, int y) {
    float s = y1 * x3 - x1 * y3 + (y3 - y1) * x + (x1 - x3) * y;
    float t = x1 * y2 - y1 * x2 + (y1 - y2) * x + (x2 - x1) * y;

    if ((s < 0) != (t < 0))
      return false;
    float A = -y2 * x3 + y1 * (x3 - x2) + x1 * (y2 - y3) + x2 * y3;
    if (A < 0.0) {
      s = -s;
      t = -t;
      A = -A;
    }
    return s > 0 && t > 0 && (s + t) < A;
  }
}


/********************************************/
/***  Class SpriteSheet                   ***/
/********************************************/
class SpriteSheet extends Image {
  public int x;
  public int y;
  public Image img = new Image();
  private int imgNum = 1;
  public int NumOfImage=0; 
  public int animationFactor = 50;
  private int drawInvokeCounter=0;
  public String imageBaseName; 
  public int height;
  public int width;

  protected int getX() {
    return x;
  }
  protected int getY() {
    return y;
  }
  protected void drawIt() {
    drawInvokeCounter++;
    if (frameCount%animationFactor==0) {
      imgNum++;
      if (imgNum>NumOfImage) {
        imgNum=1;
      }
    }
    img.setImage(imageBaseName+imgNum+".png");
    img.x=x;
    img.y=y;
    if (width>0)
      img.width= width;
    if (height>0)
      img.height = height;
    img.draw();
    x += this.advanceSpeedX();
    y += this.advanceSpeedY();
    img.x = x;
    img.y = y;
    //println(imgNum);
  }
  //public boolean pointInShape(int x1, int y1) {
  ////println(x1 >= x && x1 <= (x + width) && y1 >= y && y1 <= (y + height));
  //if (x1 >= x && x1 <= (x + width) && y1 >= y && y1 <= (y + height)) {
  //  return true;
  //} else {
  //  return false;
  //}
  //}
  public boolean pointInShape(int x1, int y1) {
    if (x1 >= x && x1 <= (x + width) && y1 >= y && y1 <= (y + height)) {
      return true;
    } else {
      return false;
    }
  }
  public void ZoomIn() {
    x-=1;
    y-=1;
    width+=2;
    height+=2;
  }
  public void ZoomOut() {
    x+=1;
    y+=1;
    width-=2;
    height-=2;
  }
}


/********************************************/
/***  Class Music                         ***/
/********************************************/
PApplet papplet = this;

import ddf.minim.*;

class Music {
  private Minim minim;
  private AudioPlayer player;

  private String path;

  public boolean loop;

  public Music() {
  }

  public void load(String path_) {

    path = path_;
    if (minim == null) {
      minim = new Minim(papplet);
    }

    if (player != null) {
      player.close();
    }

    player = minim.loadFile(path);
  }

  public void play() {
    if (player != null) {
      if (loop) {
        player.loop();
      } else {
        player.rewind();
        player.play();
      }
    }
  }

  public void stop() {
    if (player != null) {
      player.pause();
      player.rewind();
    }
  }
}





/********************************************/
/***  Class DynamicBackground             ***/
/********************************************/

class ImageNode {
  public Image background = new Image();
  public ImageNode next;
}


class DynamicBackground {
  //private Image background1 = new Image();
  //private Image background2 = new Image();
  private String imgPath1;
  private String imgPath2;
  private int backgroundDirection = Direction.LEFT;
  ImageNode node1;
  ImageNode node2; 

  public DynamicBackground()
  {
    // direction = Direction.LEFT;
  }

  void initBackImages(String img1, String img2) {
    imgPath1 = img1;
    imgPath2 = img2;
    node1 = new ImageNode();
    node1.background.setImage(img1);
    //background1.x = 0;
    //background1.y = 0;
    node1.background.direction = backgroundDirection;//Direction.LEFT;
    node1.background.speed = 1;
    node2 = new ImageNode();
    node1.background.setImage(img2);
    //background2.x = 0;
    //background2.y = 0;
    node2.background.direction = backgroundDirection;//Direction.LEFT;
    node2.background.speed = 1;
    node1.next = node2;
    node2.next = node1;
    if (backgroundDirection == Direction.LEFT)
    {
      node1.background.setImage(img1);
      node1.background.x = 0;
      node1.background.y = 0;
      node1.background.direction = backgroundDirection;//Direction.LEFT;
      node1.background.speed = 1;

      node2.background.setImage(img2);
      node2.background.x = node1.background.x + node1.background.width;
      node2.background.y = 0;
      node2.background.direction = backgroundDirection;//Direction.LEFT;
      node2.background.speed = 1;
    } else {
      node1.background.setImage(img1);
      node1.background.x = 0;
      node1.background.y = 0;
      node1.background.direction = backgroundDirection;//Direction.LEFT;
      node1.background.speed = 1;

      node2.background.setImage(img2);
      node2.background.x = node1.background.x - node1.background.width;
      node2.background.y = 0;
      node2.background.direction = backgroundDirection;//Direction.LEFT;
      node2.background.speed = 1;
    }
    this.draw();
  }

  void updateBackgroundBoundaries() {  
    if (backgroundDirection == Direction.LEFT)
    {
      if (node1.background.x == -node1.background.width) {
        node1.background.x = node2.background.x + node2.background.width;
      }

      if (node2.background.x == -node2.background.width) {
        node2.background.x = node1.background.x + node1.background.width;
      }
    } else
    {

      if (node1.background.x == node1.background.width) {
        node1.background.x = node2.background.x - node2.background.width;
      }

      if (node2.background.x == node2.background.width) {
        node2.background.x = node1.background.x - node1.background.width;
      }
    }
  }

  void draw() { 
    node1.background.draw();
    node2.background.draw();
    updateBackgroundBoundaries();
  }

  public void stop()
  {

    node1.background.speed=0;
    node2.background.speed=0;
  }
  public void run()
  {

    node1.background.speed=1;
    node2.background.speed=1;
  }
  public void setDirection(int new_direction)
  {
    backgroundDirection = new_direction;
    updateImages();
  }

  void updateImages() 
  {

    node1.background.direction = backgroundDirection;//Direction.LEFT;
    node2.background.direction = backgroundDirection;//Direction.LEFT;
    if (backgroundDirection == Direction.LEFT)
    {

      node1.background.direction = backgroundDirection;//Direction.LEFT;
      node1.background.speed = 1;


      //node2.background.x = node1.background.x + node1.background.width;
      node2.background.y = 0;
      node2.background.direction = backgroundDirection;//Direction.LEFT;
      node2.background.speed = 1;
    } 
    //if (backgroundDirection == Direction.RIGHT){
    else {
      node1.background.direction = backgroundDirection;//Direction.LEFT;
      node1.background.speed = 1;


      //node2.background.x = node1.background.x - node1.background.width;
      node2.background.y = 0;
      node2.background.direction = backgroundDirection;//Direction.LEFT;
      node2.background.speed = 1;
    }
  }
}


/********************************************/
/***  Class SplashScreen                  ***/
/********************************************/
class SplashScreen
{

  public color backgroundColor;
  public String imagePath;
  public String gameName;
  public String gameAuthor1;
  public String gameAuthor2;
  public String gameAuthor3;
  public Music introMusic;
  private boolean flag = true;

  private int time;

  public SplashScreen()
  {
    time = millis();
    introMusic=new Music();
  }
  
   public boolean show()
  {
    Rect window = new Rect();
    window.width = 650;
    window.height = 480;
    window.x = (width - window.width)/2;
    window.y = (height - window.height)/2;
    window.brush = backgroundColor;
    window.alpha = 80;

    Text gameName1 = new Text();
    gameName1.text = gameName;
    gameName1.x=window.x+50;
    gameName1.y=window.y+50;
    gameName1.font = "ARIAL";
    gameName1.textSize = 60;
    gameName1.brush  = ~backgroundColor|0xff000000;

    Text author1 = new Text();
    if (gameAuthor1!=null)
    {

      author1.text = gameAuthor1;
      author1.x=window.x+20;
      author1.y=window.y+150;
      author1.font = "ARIAL";
      author1.textSize = 40;
      author1.brush  = ~backgroundColor|0xff0ff000;
    }

    Text author2 = new Text();
    if (gameAuthor2!=null)
    {

      author2.text = gameAuthor2;
      author2.x=window.x+20;
      author2.y=window.y+200;
      author2.font = "ARIAL";
      author2.textSize = 40;
      author2.brush  = ~backgroundColor|0xff0ff000;
    }

    Text author3 = new Text();
    if (gameAuthor3!=null)
    {
      author3.text = gameAuthor3;
      author3.x=window.x+20;
      author3.y=window.y+200;
      author3.font = "ARIAL";
      author3.textSize = 40;
      author3.brush  = ~backgroundColor|0xff0ff000;
    }
    
    Image image = new Image();
    if (imagePath!=null)
    {
      image.setImage(imagePath);
      image.x=window.x+350;
      image.y = window.y+150;
    }

    if ( millis() < time + 10000) {
      window.draw();
      gameName1.draw();
      author1.draw();
      author2.draw();
      image.draw();
      if (flag==true) {
        introMusic.play();
        flag=false;
      }
      return true;
    } else
    {
      introMusic.stop();
     
      return false;
    }


    //if (height<1024 && width<600)
    //{
    //}
    
  }
}


/********************************************/
/***  Class Game             ***/
/********************************************/
private class Game
{
  public int score;
  public int live;
}

i see that the wanted info is inside a by the code generated
table,

you could try to save that as is ( on what event? )
https://processing.org/reference/saveTable_.html

now on restart you can do a
https://processing.org/reference/loadTable_.html

but it is up to you if you do that to a table with a different name
and just take out the info what you need,
or you change your system in the way that you NOT make that table ( by code )
instead ( after the first save to file ) always load / save from file.
only you have the understanding of the content and status of that table to
choose what way is better.

1 Like