//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();
}
}