xxxxxxxxxx
string saver = "";
ArrayList<Alien2> army2 = new ArrayList();
ArrayList<Alien> army = new ArrayList();
float timer,health,start,test,check = 0,checkt = 0,event = random(0,100),stats,graph,xp,xplev;
int score,bx,by,bx2,by2,bx3,by3,bx4,by4,bx5,by5,bx6,by6,bx8,bx8,bx9,by9,xDist8,yDist8,bx10,by10,bx11,by11,bx13,by13,on = 0;
int bx7,by7,by12,by12,bx14,by14,bx15,by15,bx16,by16,bx18,by18,bx19,by19,xpcust =0,alba = 0,ring = 0;
int timerM;
float ba1 = 0,ba2 = 0,ba3,ba4,ba5,ba6,ba7,ba8;
bool click = false;
float mode,beta = 0;
float n1,n2,n3,al,nt1,nt2,nt3;
str name = "",na1 = "",na2 = "",na3 = "",nt1t = "",nt2t = "",nt3t = "";
//customs
float custW, custOP,custT,custB;
void setup() {
xplev = 1;
xp = 0;
fullScreen();
graph = 0;
bx7 = 400;
by7 = height/2;
bx12 = 400;
by12 = height/2 + 200;
bx13 = 400;
by13 = height/2 + 120;
by14 = height/2+300;
bx14 = 400;
bx16 = 400;
by16 = 300;
bx18 = 100;
by18 = 100;
score = 0;
health = 1;
img = loadImage("1665593786742_8de29228f3ad901cf945835df61a24ba.png");
img2 = loadImage("Arcade_Gamer-removebg-preview.png");
load = loadImage("Screen_Shot_2023-09-29_at_6.24.32_pm-removebg-preview.png");
shurkien = loadImage("Screen_Shot_2023-09-30_at_4.06.03_pm-removebg-preview.png");
kunai = loadImage("Screen_Shot_2023-09-30_at_4.10.35_pm-removebg-preview.png");
bg2 = loadImage("Screen Shot 2023-09-30 at 6.58.50 pm.png");
bg3 = loadImage("Screen Shot 2023-09-30 at 4.52.23 pm.png");
bg4 = loadImage("Screen Shot 2023-10-01 at 11.43.46 am.png");
normlo = loadImage("Fruit_Ninja-removebg-preview.png");
tracer = loadImage("Fruit_Ninja__1_-removebg-preview.png");
xDist12 = 1000;
yDist12 = 1000;
xDist13 = 1000;
yDist13 = 1000;
xDist14 = 1000;
yDist14 = 1000;
xDist16 = 1000;
yDist16 = 1000;
xDist7 = 1000;
yDist7 = 1000;
event = random(1,80);
start = 0;
bx = width/2;
by = height/2 + 50;
bx2 = width/2 - 200;
by2 = height/2 + 50;
bx3 = width/2 + 200;
by3 = height/2 + 50;
bx4 = width - 70;
by4 = 50;
bx5 = width/2 - 50;
by5 = height-50;
bx6 = 100;
by6 = 100;
bx8 = width/2 + 200;
by8 = height/2;
bx9 = width/2 - 200;
by9 = height/2;
test = 0;
n1 = 0;
n2 = 0;
n3 = 0;
nt1 = 0;
nt2 = 0;
nt3 = 0;
al = 0;
custW = 5;
custOP = 1;
custT = 1;
custB = 1;
mode = 0;
timerM = 10;
stats = 0;
safe = 0;
bx15 = 100;
by15 = 100;
total = 0;
bx19 = 50;
by19 = height - 50;
}
void draw() {
frameRate(60);
xDist8 = abs(mouseX - bx8);
yDist8 = abs(mouseY - by8);
xDist9 = abs(mouseX - bx9);
yDist9 =abs(mouseY - by9);
if (xp >= xplev * 50) {
xplev += 1;
xp = 0;
xpcust = 1;
}
if (check > n1) {
n3 = n2;
n2 = n1;
n1 = check;
na3 = na2;
na2 = na1;
na1 = name;
} else if (check > n2 && check < n1) {
n3 = n2;
n2 = check;
na3 = na2;
na2 = name;
} else if (check > n3 && check < n2) {
n3 = check;
na3 = name;
}
if (checkt > nt1) {
nt3 = nt2;
nt2 = nt1;
nt1 = checkt;
nt3t = nt2t;
nt2t = nt1t;
nt1t = name;
} else if (checkt > nt2 && checkt < nt1) {
nt3 = n2;
nt2 = check;
nt3t = nt2t;
nt2t = name;
} else if (checkt > nt3 && checkt < nt2) {
nt3 = checkt;
nt3t = name;
}
noStroke();
rectMode(CORNER);
// tint(255,5);
fill(255);
rect(0,0,width,height);
if (custB == 1) {
image(img, 0, 0,width,height);
}
if (custB == 2) {
image(bg2, 0, 0,width,height);
}
if (custB == 3) {
image(bg3, 0, 0,width,height);
}
if (custB == 4) {
image(bg4, 0, 0,width,height);
}
strokeWeight(7);
if (custT == 1) stroke(0);
if (custT == 2) stroke(255,0,0);
if (custT == 3) stroke(0,255,0);
if (custT == 4) stroke(0,0,255);
if (custT == 5) stroke(0,255,255);
if (custT == 6) stroke(255,255,0);
if (custT == 7) stroke(255,0,255);
if (custT == 8) stroke(255,255,255);
if (custT == 0) stroke(random(255),random(255),random(255));
if (custT <= 8) {
line(mouseX,mouseY,pmouseX,pmouseY);
}
stroke(0);
textSize(30);
textMode(CENTER);
if (custW == 1) {
text("🗡",mouseX,mouseY);
noCursor();
}
if (custW == 2) {
text("🔪",mouseX,mouseY);
noCursor();
}
if (custW == 3) {
image(shurkien,mouseX,mouseY,25,25);
noCursor();
}
if (custW == 4) {
image(kunai,mouseX-15,mouseY-15,25,25);
noCursor();
}
if (custW > 4 || custW <= 0) {
cursor(HAND);
}
if (start == 11) {
fill(181, 132, 69);
textSize(100);
text("BADGES",width/2,160);
if (ba2 == 0) {
fill(255,0,0);
}
if (ba2 == 1) {
fill(0,255,0);
}
rect(200,height/2-130,210,80);
fill(255);
textSize(25);
text("Crash Course",300,height/2- 100);
textSize(15);
text("Die or leave for the first time \n +25xp",310,height/2-80);
if (ba4 == 0) {
fill(255,0,0);
}
if (ba4 == 1) {
fill(0,255,0);
}
rect(500,height/2+100,210,80);
fill(255);
textSize(25);
text("Time King",600,height/2+ 130);
textSize(15);
text("Get 38 points in \n Time Racer +45xp",610,height/2+150);
if (ba3 == 0) {
fill(255,0,0);
}
if (ba3 == 1) {
fill(0,255,0);
}
rect(500,height/2-130,210,80);
fill(255);
textSize(25);
text("Team 100",600,height/2- 100);
textSize(15);
text("Get 100 points in \n one game +55xp",610,height/2-80);
if (ba6 == 0) {
fill(255,0,0);
}
if (ba6 == 1) {
fill(0,255,0);
}
rect(800,height/2-130,210,80);
fill(255);
textSize(22);
text("Touch Some Grass",900,height/2- 100);
textSize(15);
text("Get 200 points in \n one game +250xp",910,height/2-80);
if (ba7 == 0) {
fill(255,0,0);
}
if (ba7 == 1) {
fill(0,255,0);
}
rect(1100,height/2+100,210,80);
fill(255);
textSize(20);
text("Master Fruit Ninja",1200,height/2+ 130);
textSize(15);
text("Get 2000 points in \n total +450xp",1210,height/2+150);
if (ba8 == 0) {
fill(255,0,0);
}
if (ba8 == 1) {
fill(0,255,0);
}
rect(1100,height/2-130,210,80);
fill(255);
textSize(20);
text("HOW...",1200,height/2- 100);
textSize(15);
text("Get 20000 points in \n total +2000xp",1210,height/2-80);
if (ba1 == 0) {
fill(255,0,0);
}
if (ba1 == 1) {
fill(0,255,0);
}
rect(200,height/2+100,210,80);
fill(255);
textSize(25);
text("The Beggining",300,height/2+130);
textSize(15);
text("Play your first match \n of fruit ninja! +15xp",310,height/2+150);
if (ba5 == 0) {
fill(255,0,0);
}
if (ba5 == 1) {
fill(0,255,0);
}
rect(800,height/2+100,210,80);
fill(255);
textSize(22);
text("Time Racer Master",900,height/2+130);
textSize(15);
text("Get 50 points in \n one game +120xp",910,height/2+150);
fill(181, 132, 69);
ellipse(bx18,by18,50,50);
textSize(25);
fill(255);
text("🗡",bx18,by18+10);
if (dist(mouseX,mouseY,bx18,by18) < 50) {
bx18 += random(-1,1);
by18 += random(-1,1);
}
if (dist(mouseX,mouseY,bx18,by18) > 50) {
bx18 = 100;
by18 = 100;
}
}
if (start == 7) {
rectMode(CENTER);
xDist7 = abs(mouseX - bx7);
yDist7 = abs(mouseY - by7);
xDist12 = abs(mouseX - bx12);
yDist12 = abs(mouseY - by12);
xDist13 = abs(mouseX - bx13);
yDist13 = abs(mouseY - by13);
xDist14 = abs(mouseX - bx14);
yDist14 = abs(mouseY - by14);
xDist16 = abs(mouseX - bx16);
yDist16 = abs(mouseY - by16);
if (stats == 0) {
fill(255,0,0);
}
if (stats == 1) {
fill(0,255,0);
}
rect(bx12,by12,160,50);
fill(255);
textSize(25);
text("Statistics",bx12,by12+ 5);
fill(181, 132, 69);
rect(bx14,by14,160,50);
if (graph == 0) {
fill(255);
textSize(25);
text("Normal",bx14,by14+ 5);
}
if (graph == 1) {
fill(255);
textSize(25);
text("Bad",bx14,by14+ 5);
}
if (xDist14 < 160 && yDist14 < 50) {
bx14 += random(-1,1);
by14 += random(-1,1);
textSize(20);
fill(255);
text("Toggle between bad and normal graphics for fruits",bx13+350,height/2 + 305);
}
if (xDist7 > 160 && yDist7 > 50) {
bx14 = 400;
by14 = height/2 + 300;
}
if (beta == 0) {
fill(255,0,0);
}
if (beta == 1) {
fill(0,255,0);
}
rect(bx7,by7,160,50);
fill(255);
textSize(25);
text("Beta Features",bx7,by7);
text("Beta features:\n>Exit Button\n>XP toggle",bx7,by7+50);
if (xDist7 < 160 && yDist7 < 50) {
bx7 += random(-1,1);
by7 += random(-1,1);
textSize(20);
fill(255);
text("Turn on beta features (remember these are not completed so they may be a bit buggy)",bx7+480,by7);
}
if (xDist7 > 160 && yDist7 > 50) {
bx7 = 400;
by7 = height/2 - 50;
}
if (xDist12 < 160 && yDist12 < 50) {
bx12 += random(-1,1);
by12 += random(-1,1);
textSize(20);
fill(255);
text("When you play a game your FPS will be displayed",bx12+340,height/2 + 125);
}
if (xDist12 > 160 && yDist12 > 50) {
bx12 = 400;
by12 = height/2 + 120;
}
//safe
if (safe == 0) {
fill(255,0,0);
}
if (safe == 1) {
fill(0,255,0);
}
rect(bx13,by13,160,50);
textSize(25);
fill(255)
text("Lag protection",bx13,by13 + 5);
if (xDist13 < 160 && yDist13 < 50) {
bx13 += random(-1,1);
by13 += random(-1,1);
textSize(20);
fill(255);
text("If you FPS drops below 1 in a game it will put you back into the home screen",bx13+450,by13+5);
}
if (xDist13 > 160 && yDist13 > 50) {
bx13 = 400;
by13 = height/2 + 220;
}
//end of safe
if (on == 0) {
fill(255,0,0);
}
if (on == 1) {
fill(0,255,0);
}
if (beta == 1) {
rect(bx16,by16,160,50);
fill(255);
textSize(25);
text("XP off",bx16,by16+ 5);
}
if (xDist16 < 160 && yDist16 < 50) {
bx16 += random(-1,1);
by16 += random(-1,1);
textSize(20);
fill(255);
if (beta == 1) {
text("Toggle xp off/on (This will unlock locked customs)",bx16+350,by16+5);
}
}
if (xDist16 > 160 && yDist16 > 50) {
bx16 = 400;
by16 = 200;
}
textSize(100);
fill(181, 132, 69)
text("SETTINGS",width/2,150);
fill(181, 132, 69);
ellipse(bx10,by10,50,50);
textSize(27);
textAlign(CENTER);
text("🔙",bx10,by10+ 10);
if (dist(mouseX,mouseY,bx10,by10) < 30) {
bx10 += random(-1,1);
by10 += random(-1,1);
}
if (dist(mouseX,mouseY,bx10,by10) > 30) {
bx10 = 50;
by10 = 50;
}
}
if (start == 6) {
mode = 0;
textSize(30);
fill(181, 132, 69);
ellipse(bx19,by19,50,50);
text("🔙",bx19,by19);
if (dist(bx19,by19,mouseX,mouseY) < 50) {
bx19 += random(-1,1);
by19 += random(-1,1);
}
if (dist(bx19,by19,mouseX,mouseY) > 50) {
bx19 = 50;
by19 = height - 50;
}
xDist8 = abs(mouseX - bx8);
yDist8 = abs(mouseY - by8);
image(normlo,width/2 - 50,height/2 - 400);
rectMode(CENTER);
fill(181, 132, 69);
rect(bx8,by8,120,50);
textSize(25);
fill(0);
text("Normal",bx8,by8);
if (xDist8 < 120 && yDist8 < 50) {
bx8 += random(-1,1);
by8 += random(-1,1);
textSize(15);
fill(181, 132, 69);
text("The aim is to cut all the fruit you see but avoid the bombs!\n Collect the special Heart Fruit gain an extra heart! \n Every 19 seconds a random event will happen which will ever be good or bad! \n You have three lives good luck!",width/2+200,height/2 + 100);
}
if (xDist8 > 120 && yDist8 > 50) {
bx8 = width/2+200;
by8 = height/2;
}
rectMode(CENTER);
fill(181, 132, 69);
rect(bx9 -120,by9,120,50);
textSize(20);
fill(0);
image(tracer,width/2 - 500,height/2 - 400)
text("Time \n Racer",bx9 - 120,by9);
xDist9 = abs(mouseX - bx9 + 120);
yDist9 = abs(mouseY - by9);
if (xDist9 < 120 && yDist9 < 50) {
bx9 += random(-1,1);
by9 += random(-1,1);
textSize(15);
fill(181, 132, 69);
text("In this game mode you have 10 seconds to live!\n Cut fruit to gain extra time! \n But avoid the bombs they minus 3 seconds! \n Good Luck and stay alive!",width/2-230,height/2+100);
}
if (xDist9 > 120 && yDist9 > 50) {
bx9 = width/2-120;
by9 = height/2;
}
}
if (start == 5) {
if (ring <= 0) {
stroke(0,0,0);
}
if (ring >= 1) {
stroke(random(0,255),random(0,255),random(0,255));
}
fill(181, 132, 69);
ellipse(bx18,by18,50,50);
textSize(25);
text("🎖️",bx18,by18+10);
if (dist(mouseX,mouseY,bx18,by18) < 50) {
bx18 += random(-1,1);
by18 += random(-1,1);
}
if (dist(mouseX,mouseY,bx18,by18) > 50) {
bx18 = 100;
by18 = 100;
}
stroke(0);
xDist4 = abs(mouseX - bx4);
yDist4 = abs(mouseY - by4);
fill(181, 132, 69);
textSize(27);
textAlign(CENTER);
ellipse(bx4,by4,50,50);
text("🔙",bx4,by4 + 10);
if (xDist4 < 60 && yDist4 < 30) {
bx4 += random(-1,1);
by4 += random(-1,1);
}
if (xDist4 > 60 && yDist4 > 30) {
bx4 = width-70;
by4 = 50;
}
if(army2.size() < 4)
army2.add(new Alien2(100,220, "Weapon"));
army2.add(new Alien2(100,320, "Trail"));
army2.add(new Alien2(100,420, "Backdrop"));
bx6 = 400;
by6 = height - 535;
noStroke();
fill(181, 132, 69);
ellipse(bx6,by6, 25,25);
textSize(25);
fill(0);
text("?",bx6,by6 + 10);
if (dist(bx6,by6,mouseX,mouseY) < 10) {
fill(255);
text("To select an Customization option TYPE the number that is shown onn the box",bx6 + 450,by6 + 50);
}
for(Alien2 eachAlien2: army2) {
eachAlien2.render();
}
strokeWeight(7);
if (custOP == 1) {
textSize(65);
fill(255);
textAlign(CENTER);
text("Weapon",width/2,height/2-200);
textSize(25);
fill(181, 132, 69);
rect(550,height - 200,80,80);
rect(650,height - 200,80,80);
rect(750,height - 200,80,80);
rect(850,height - 200,80,80);
rect(950,height - 200,80,80);
fill(255);
text("1.",532,height-210); // x -18 y + 10
text("2.",632,height-210);
text("3.",732,height-210);
text("4.",832,height-210);
text("5.",932,height-210);
textSize(30);
text("🗡",550,height - 185);
text("🔪",660,height - 185);
image(shurkien,740,height - 200,30,30);
image(kunai,840,height - 200,30,30);
text("",955,height - 180);
textSize(50);
fill(255);
if (on == 0) {
if (xplev < 5) {
textSize(50);
text("❌",552,height-180);
textSize(20);
text("LOCKED \n level 5",552,height-120);
}
if (xplev < 10) {
textSize(50);
text("❌",652,height-180);
textSize(20);
text("LOCKED \n level 10",652,height-120);
}
if (xplev < 20) {
textSize(50);
text("❌",752,height-180);
textSize(20);
text("LOCKED\nlevel 20",752,height-120);
}
if (xplev < 50) {
textSize(50);
text("❌",852,height-180);
textSize(20);
text("LOCKED \n level 50",852,height-120);
}
}
}
if (custOP == 2) {
textSize(65);
fill(255);
textAlign(CENTER);
text("Trail",width/2,height/2-200);
textSize(25);
fill(0,0,0);
rect(450,height - 200,80,80);
fill(255,0,0);
rect(550,height - 200,80,80);
fill(0,255,0);
rect(650,height - 200,80,80);
fill(0,0,255);
rect(750,height - 200,80,80);
fill(0,255,255);
rect(850,height - 200,80,80);
fill(255,255,0);
rect(950,height - 200,80,80);
fill(255,0,255);
rect(1050,height - 200,80,80);
fill(255,255,255);
rect(1150,height - 200,80,80);
fill(181, 132, 69);
rect(1250,height - 200,80,80);
fill(random(255),random(255),random(255));
rect(350,height - 200,80,80);
fill(255);
text("0.",332,height-210);
text("1.",432,height-210); // x -18 y + 10
text("2.",532,height-210);
text("3.",632,height-210);
text("4.",732,height-210);
text("5.",832,height-210);
text("6.",932,height-210); // x -18 y + 10
text("7.",1032,height-210);
fill(0);
text("8.",1132,height-210);
text("9.",1232,height-210);
text("❌",1250,height - 180);
if (on == 0) {
if (xplev < 80) {
textSize(50);
text("❌",352,height-180);
textSize(20);
fill(255);
text("LOCKED\nlevel 80",352,height-120);
}
}
}
if (custOP == 3) {
strokeWeight(20);
textSize(65);
fill(255);
textAlign(CENTER);
text("Background",width/2,height/2-200);
textSize(25);
fill(181, 132, 69);
rect(width/2 + 100,height - 200,100,100);
image(bg2,width/2 + 50,height - 250,100,100);
rect(width/2 - 200,height - 200,100,100);
image(img,width/2 - 250,height - 250,100,100);
rect(width/2 - 60,height - 200,100,100);
image(bg3,width/2 - 110,height - 250,100,100);
rect(width/2 + 250,height - 200,100,100);
image(bg4,width/2 + 200,height - 250,100,100);
fill(255);
text("1.",width/2 - 230,height-220); // x -18 y + 10
text("2.",width/2 - 83,height-220); // x -18 y + 10
text("3.",width/2 + 70,height-220);
text("4.",width/2 + 222,height-220);
}
}
strokeWeight(7);
if (start == 4) {
bx3 = 100;
by3 = height-50;
textSize(50);
textAlign(CENTER);
text("Welcome to Fruit Ninja Processing",width/2,height/2 - 100);
textSize(25);
text("This is a fan made game by Overitbynow! \n This game has taken me so long so i really hope you enjoy it.\n \n \n \n Total fruit cut: " + total,width/2,height/2 - 50);
fill(181, 132, 69);
rectMode(CENTER);
if (xDist3 < 60 && yDist3 < 30) {
bx3 += random(-1,1);
by3 += random(-1,1);
}
if (xDist3 > 60 && yDist3 > 30) {
bx3 = 100;
by3 = height - 50;
}
rect(bx3,by3,100,50)
fill(255);
textSize(25);
textAlign(CENTER,CENTER);
text("Back",bx3,by3);
xDist3 = abs(mouseX - bx3);
yDist3 = abs(mouseY - by3);
}
if (start == 3) {
textSize(150);
text("👑",width/2,50);
textSize(50);
fill(255, 215, 0);
text("HIGHSCORES",width/2,150);
image(load,width/2 - 500,height/2 - 50);
textAlign(CENTER,CENTER);
textSize(50);
fill(181, 132, 69);
text("Normal Mode",width/2-265,height/2 + 200)
fill(255, 215, 0);
text(na1 +"\n"+ n1, width/2 - 265, height/2 - 50)
fill(192, 192, 192);
text(na2 +"\n"+ n2, width/2 - 380, height/2)
fill(205, 127, 50);
text(na3 +"\n"+ n3, width/2 - 130, height/2)
text("Timer Racer",width/2+265,height/2 + 200)
image(load,width/2 + 15,height/2 - 50);
textAlign(CENTER,CENTER);
textSize(50);
fill(255, 215, 0);
text(nt1t +"\n"+ nt1, width/2 + 265, height/2 - 50)
fill(192, 192, 192);
text(nt2t +"\n"+ nt2, width/2 + 380, height/2)
fill(205, 127, 50);
text(nt3t +"\n"+ nt3, width/2 + 130, height/2)
bx2 = 100;
by2 = height - 50;
if (xDist2 < 60 && yDist2 < 30) {
bx2 += random(-1,1);
by2 += random(-1,1);
}
if (xDist2 > 60 && yDist2 > 30) {
bx2 = 100;
by2 = height - 50;
}
fill(181, 132, 69);
rectMode(CENTER);
rect(bx2,by2,100,50)
fill(255);
textSize(25);
textAlign(CENTER,CENTER);
text("BACK",bx2,by2);
xDist2 = abs(mouseX - bx2);
yDist2 = abs(mouseY - by2);
}
if (start == 0 || test == 1) {
fill(181, 132, 69);
ellipse(bx10,by10,50,50);
textSize(27);
textAlign(CENTER);
text("⚙️",bx10,by10+ 10);
if (dist(mouseX,mouseY,bx10,by10) < 30) {
bx10 += random(-1,1);
by10 += random(-1,1);
}
if (dist(mouseX,mouseY,bx10,by10) > 30) {
bx10 = 50;
by10 = 50;
}
custOP = 0;
xDist4 = abs(mouseX - bx4);
yDist4 = abs(mouseY - by4);
fill(181, 132, 69);
textSize(27);
textAlign(CENTER);
if (xpcust == 1 && on == 0) stroke(random(255),random(255),random(255));
if (ring == 1) stroke(random(255),random(255),random(255));
ellipse(bx4,by4,50,50);
text("🗡️",bx4,by4 + 10);
stroke(0);
if (xDist4 < 60 && yDist4 < 30) {
bx4 += random(-1,1);
by4 += random(-1,1);
}
if (xDist4 > 60 && yDist4 > 30) {
bx4 = width-70;
by4 = 50;
}
bx5 = width/2 - 50- (name.length() * 5);
by5 = height-70;
fill(181, 132, 69);
noStroke();
fill(0);
fill(181, 132, 69);
ellipse(bx5,by5,20,20);
fill(0);
textSize(20);
textAlign(CENTER);
text("?",bx5,by5 + 8);
if (dist(mouseX,mouseY,bx5,by5) < 20) {
fill(255)
text("To delete press (-) ",bx5 + 95,by5 + 5);
}
fill(181, 132, 69);
strokeWeight(7);
stroke(0);
textAlign(CENTER);
textSize(20);
// timer = 0;
if (on == 0) {
text("Last score: " + score + " points!",width/2 - 100,50);
}
if (on == 1) {
text("Last score: " + score + " points!",width/2,50);
}
if (on == 0) {
text(" | ",width/2,50);
}
textAlign(CORNER);
if (on == 0) {
text("Level: " + xplev + " (" + xp + " out of " + xplev * 50+")",width/2 +10,50);
}
textSize(100);
fill(255);
textAlign(CENTER,CENTER);
image(img2,width/2-250,height/2-400);
textSize(30);
al -= 3;
fill(255,255,255,al);
text("Please enter your name or username!",width/2,height/2 - 40);
fill(181, 132, 69);
xDist = abs(mouseX - bx);
yDist = abs(mouseY - by);
rectMode(CENTER);
rect(bx,by,100,50);
fill(255);
textSize(25);
text("START",bx,by);
if (xDist < 60 && yDist < 30) {
bx += random(-1,1);
by += random(-1,1);
}
if (xDist > 60 && yDist > 30) {
bx = width/2;
by = height/2 + 50;
}
xDist2 = abs(mouseX - bx2);
yDist2 = abs(mouseY - by2);
xDist3 = abs(mouseX - bx3);
yDist3 = abs(mouseY - by3);
// bx = width/2;
// by = height/2 + 50;
fill(181, 132, 69);
rect(bx2,by2,100,50)
fill(255);
text("HIGH",bx2,by2);
if (xDist2 < 60 && yDist2 < 30) {
bx2 += random(-1,1);
by2 += random(-1,1);
}
if (xDist2 > 60 && yDist2 > 30) {
bx2 = width/2 - 200;
by2 = height/2 + 50;
}
if (xDist3 < 60 && yDist3 < 30) {
bx3 += random(-1,1);
by3 += random(-1,1);
}
if (xDist3 > 60 && yDist3 > 30) {
bx3 = width/2 + 200;
by3 = height/2 + 50;
}
textSize(50);
textSize(25);
text("name: " + name,width/2,height-50);
fill(181, 132, 69);
rect(bx3,by3,100,50)
fill(255);
text("INFO",bx3,by3);
}
if (start == 1) {
if (frameRate < 1 && safe == 1) {
health = 0;
print("Kicked because fps dropped to low");
}
if (stats == 1) {
fill(255,255,255,50);
textSize(20);
text("fps: "+frameRate,10,200);
}
if (beta == 1) {
fill(255,255,255);
ellipse(bx10,by10,50,50);
textSize(25);
noStroke();
fill(255,0,0);
text("🔙",bx10 - 10,by10 + 10);
stroke(7);
if (dist(bx10,by10,mouseX,mouseY) < 50) {
bx10 += random(-1,1);
by10 += random(-1,1);
}
if (dist(bx10,by10,mouseX,mouseY) > 50) {
bx10 = 50;
by10 = 100;
}
}
for (Alien thisAlien: army) {
if (thisAlien.death < 20) {
thisAlien.downS = 0;
}
}
if (health == 3 && mode == 1) {
fill(0);
textSize(50);
text("❤️❤️❤️",10,50);
} else if(health == 2) {
fill(0);
textSize(50);
text("❤️❤️",10,50);
} else if(health == 1) {
fill(0);
textSize(50);
text("❤️",10,50);
}
timer += 1/60;
timerM -= 1/60;
if (mode == 2) {
fill(181, 132, 69);
textSize(100);
text(timerM,width/2,100);
if (timerM <= 0) {
health = 0;
}
}
if (mode == 1) {
if (timer > 19) {
if (event <= 20) {
textSize(100);
textAlign(CENTER,CENTER);
fill(255,0,0);
text("BOMB TIME",width/2,height/2);
if(army.size() <= 5) {
for(int iter = 0;iter < 7;iter++) {
army.add(new Alien());
}
}
for(Alien thisAlien: army) {
thisAlien.death = 10;
}
}
if (event <= 40 && event > 20) {
textSize(100);
textAlign(CENTER,CENTER);
fill(0,255,0);
text("TRIPLE POINTS",width/2,height/2);
for (Alien thisAlien: army) {
if (dist(mouseX,mouseY,thisAlien.xPos2,thisAlien.yPos2) < 60 && thisAlien.death > 20 && start == 1 && thisAlien.heart > 10) {
army.remove(thisAlien);
score+= 3;
}
}
}
if (event <= 60 && event > 40) {
textSize(100);
textAlign(CENTER,CENTER);
fill(0,255,0);
text("NO BOMB HAVEN",width/2,height/2);
for(Alien thisAlien: army) {
thisAlien.death = 90;
}
if(army.size() <= 5) {
for(int iter = 0;iter < 3;iter++) {
army.add(new Alien());
}
}
}
if (event <= 80 && event > 60) {
textSize(100);
textAlign(CENTER,CENTER);
fill(255,0,0);
text("BOMBS AWAY",width/2,height/2);
for(Alien thisAlien: army) {
thisAlien.death = 10;
}
if(army.size() <= 5) {
for(int iter = 0;iter < 4;iter++) {
army.add(new Alien());
}
}
}
if (event <= 100 && event > 80) {
textSize(100);
textAlign(CENTER,CENTER);
fill(255,0,0);
text("Homing bombs",width/2,height/2);
for(Alien thisAlien: army) {
// thisAlien.xPos2 = mouseX;
thisAlien.ySpeed = -16;
thisAlien.xSpeed = 0;
}
for(Alien thisAlien: army) {
thisAlien.death = 10;
}
}
}
if (timer > 26) {
timer = 0;
event = random(0,100);
}
}
for(Alien eachAlien: army) {
eachAlien.render();
eachAlien.move();
}
if (army.size() <= 2 && mode == 1) {
army.add(new Alien());
army.add(new Alien());
army.add(new Alien());
army.add(new Alien());
} else if (army.size() <= 2 && mode == 2) {
army.add(new Alien());
army.add(new Alien());
army.add(new Alien());
army.add(new Alien());
}
for (Alien thisAlien: army) {
if (thisAlien.xPos2 > width || thisAlien.xPos2 < 0 || thisAlien.yPos2 > height) army.remove(thisAlien), thisAlien.downS = random(0,300);
}
for (Alien thisAlien: army) {
if (dist(mouseX,mouseY,thisAlien.xPos2,thisAlien.yPos2) < 60 && thisAlien.death < 20 && start == 1) {
noStroke();
army.remove(thisAlien);
if (mode == 1) {
health-= 1;
}
if (mode == 2) {
timerM -= 3;
}
}
if (dist(mouseX,mouseY,thisAlien.xPos2,thisAlien.yPos2) < 60 && thisAlien.death > 20 && start == 1 && thisAlien.heart > 5) {
army.remove(thisAlien);
if (mode == 2) {
timerM += 0.3;
}
score+= 1;
total += 1;
xp += 4;
}
}
if (health <= 0) {
// if (ba1 == 0) ba1 = 1,ring == 1;
if (ba2 == 0) ba2 = 1,ring == 1,xp += 25;
if (ba3 == 0 && score >= 100) ba3 = 1,ring == 1,xp += 55;
if (ba4 == 0 && score >= 38 && mode == 2) ba4 = 1,ring == 1,xp += 45;
if (ba5 == 0 && score >= 50 && mode == 2) ba5 = 1,ring == 1,xp += 120;
if (ba6 == 0 && score >= 200) ba6 = 1,ring == 1,xp += 250;
if (ba7 == 0 && total >= 2000) ba7 = 1,ring == 1,xp += 450;
if (ba8 == 0 && total >= 20000) ba8 = 1,ring == 1,xp += 2000;
for (Alien thisAlien: army) {
army.remove(thisAlien);
}
army.remove(0);
fill(0);
image(img, 0, 0,width,height);
start = 0;
if (mode == 1) {
check = score;
}
if (mode == 2) {
checkt = score;
}
}
for (Alien thisAlien: army) {
if (dist(mouseX,mouseY,thisAlien.xPos2,thisAlien.yPos2) < 60 && thisAlien.heart < 5 && start == 1 && health <= 2) {
noStroke();
health += 1;
army.remove(thisAlien);
xp += 4;
total += 1;
} else if (dist(mouseX,mouseY,thisAlien.xPos2,thisAlien.yPos2) < 60 && thisAlien.heart < 5 && start == 1 && health >= 3) {
score += 5;
total += 1;
army.remove(thisAlien);
xp += 4;
}
}
textSize(100);
fill(255,255,255);
textAlign(CORNER);
textSize(50);
text(score,width - 90,50);
}
}
void keyPressed() {
if(key == 'm') {
print(xp+ "|"+xplev+"|"+ n1+"|"+n2+"|"+n3+"|"+"|"+nt1+"|"+nt2+"|"+nt3+"|"+
na1+"|"+na2 +"|"+na3 +"|"+nt1t +"|"+nt2t+"|"+nt3t );
}
if (name.length() <= 8 && start == 0) {
if (key == '1') name += "1";
if (key == '2') name += "2";
if (key == '3') name += "3";
if (key == '4') name += "4";
if (key == '5') name += "5";
if (key == '6') name += "6";
if (key == '7') name += "7";
if (key == '8') name += "8";
if (key == '9') name += "9";
if (key == '0') name += "0";
if (key == 'a') name += "a";
if (key == 'b') name += "b";
if (key == 'c') name += "c";
if (key == 'd') name += "d";
if (key == 'e') name += "e";
if (key == 'f') name += "f";
if (key == 'g') name += "g";
if (key == 'h') name += "h";
if (key == 'i') name += "i";
if (key == 'j') name += "j";
if (key == 'k') name += "k";
if (key == 'l') name += "l";
if (key == 'm') name += "m";
if (key == 'o') name += "o";
if (key == 'p') name += "p";
if (key == 'q') name += "q";
if (key == 'r') name += "r";
if (key == 's') name += "s";
if (key == 'n') name += "n";
if (key == 't') name += "t";
if (key == 'u') name += "u";
if (key == 'v') name += "v";
if (key == 'w') name += "w";
if (key == 'x') name += "x";
if (key == 'y') name += "y";
if (key == 'z') name += "z";
if (key == 'A') name += "A";
if (key == 'B') name += "B";
if (key == 'C') name += "C";
if (key == 'D') name += "D";
if (key == 'E') name += "E";
if (key == 'F') name += "F";
if (key == 'G') name += "G";
if (key == 'H') name += "H";
if (key == 'I') name += "I";
if (key == 'J') name += "J";
if (key == 'K') name += "K";
if (key == 'L') name += "L";
if (key == 'M') name += "M";
if (key == 'N') name += "N";
if (key == 'O') name += "O";
if (key == 'P') name += "P";
if (key == 'Q') name += "Q";
if (key == 'R') name += "R";
if (key == 'S') name += "S";
if (key == 'T') name += "T";
if (key == 'U') name += "U";
if (key == 'V') name += "V";
if (key == 'W') name += "W";
if (key == 'X') name += "X";
if (key == 'Y') name += "Y";
if (key == 'Z') name += "Z";
}
if (start == 0) {
if (key == '-') name = "";
}
if (key == '/') print(frameRate);
if (custOP == 1) {
if (xplev >= 5&&key == '1' && on == 0) custW = 1;
if (xplev >= 10&&key == '2'&& on == 0) custW = 2;
if (xplev >= 20&&key == '3'&& on == 0) custW = 3;
if (xplev >= 50&&key == '4'&& on == 0) custW = 4;
if (xplev >= 1&&key == '5'&& on == 0) custW = 0;
if (on == 1) {
if (key == '1') custW = 1;
if (key == '2') custW = 2;
if (key == '3') custW = 3;
if (key == '4') custW = 4;
if (key == '5') custW = 0;
}
}
if (custOP == 2) {
if (key == '1') custT = 1;
if (key == '2') custT = 2;
if (key == '3') custT = 3;
if (key == '4') custT = 4;
if (key == '5') custT = 5;
if (key == '6') custT = 6;
if (key == '7') custT = 7;
if (key == '8') custT = 8;
if (key == '9') custT = 9;
if (on == 0) {
if (xplev >= 80) {
if (key == '0') custT = 0;
}
}
if (on == 1) {
if (key == '0') custT = 0;
}
}
if (custOP == 3) {
if (key == '1') custB = 1;
if (key == '3') custB = 2;
if (key == '2') custB = 3;
if (key == '4') custB = 4;
}
}
void mousePressed() {
if (dist(mouseX,mouseY,bx18,by18) < 50 && start == 5) {
start = 11;
ring = 0;
} else if (dist(mouseX,mouseY,bx18,by18) < 50 && start == 11) {
start = 5;
}
if (xDist16 < 160 && yDist16 < 50 && start == 7 && beta == 1) {
if (on == 0) {
on = 1;
} else if(on == 1) {
on = 0;
}
}
if (xDist14 < 160 && yDist14 < 50 && start == 7) {
if (graph == 0) {
graph = 1;
} else if(graph == 1) {
graph = 0;
}
}
if (xDist13 < 160 && yDist13 < 50 && start == 7) {
if (safe == 0) {
safe = 1;
} else if(safe == 1) {
safe = 0;
}
}
if (xDist7 < 160 && yDist7 < 50 && start == 7) {
if (beta == 0) {
beta = 1;
} else if(beta == 1) {
beta = 0;
}
}
if (xDist12 < 160 && yDist12 < 50 && start == 7) {
if (stats == 0) {
stats = 1;
} else if(stats == 1) {
stats = 0;
}
}
if (dist(bx10,by10,mouseX,mouseY) < 50 && start == 0) {
start = 7;
} else if(dist(bx10,by10,mouseX,mouseY) < 50 && start == 7) {
start = 0;
}
if (dist(bx10,by10,mouseX,mouseY) < 50 && start == 1 && beta == 1) {
health = 0;
}
if (xDist2 < 60 && yDist2 < 30 && start == 0) {
start = 3;
} else if (xDist2 < 60 && yDist2 < 30 && start == 3) {
start = 0;
}
if (xDist9 < 120 && yDist9 < 50 && start == 6) {
mode = 2;
start = 1;
health = 3;
timerM = 10;
score = 0;
if (ba1 == 0) {
ring = 1;
xp += 15;
ba1 = 1;
}
}
if (xDist < 60 && yDist < 30 && start == 0) {
if (name.length() >= 2) {
health = 0;
start = 6;
} else {
al = 255;
}
}
if (xDist8 < 120 && yDist8 < 50 && start == 6) {
start = 1;
mode = 1;
health = 3;
timer = 0;
score = 0;
if (ba1 == 0) {
ring = 1;
xp += 15;
ba1 = 1;
}
}
if (xDist3< 60 && yDist3 < 30 && start == 0) {
start = 4;
} else if(xDist3< 60 && yDist3 < 30 && start == 4) {
start = 0;
}
if (xDist4< 60 && yDist4 < 30 && start == 0) {
start = 5;
custOP = 1;
} else if(xDist4< 60 && yDist4 < 30 && start == 5) {
start = 0;
xpcust = 0;
}
if (dist(bx19,by19,mouseX,mouseY) < 50) {
start = 0;
}
for (Alien2 thisAlien2: army2) {
if (thisAlien2.xPos == 100 && thisAlien2.yPos == 220 && dist(mouseX,mouseY,thisAlien2.xPos,thisAlien2.yPos) < 70) {
custOP = 1;
}
if (thisAlien2.xPos == 100 && thisAlien2.yPos == 320 && dist(mouseX,mouseY,thisAlien2.xPos,thisAlien2.yPos) < 70) {
custOP = 2;
}
if (thisAlien2.xPos == 100 && thisAlien2.yPos == 420 && dist(mouseX,mouseY,thisAlien2.xPos,thisAlien2.yPos) < 70) {
custOP = 3;
}
}
}