p5.disableFriendlyErrors = true;
img = loadImage("thumb2.png")
background(20, 243, 255);
if (coolmode==1) {background(20, 243, 255,50)} else
{background(20, 243, 255)}
if (home==0){rect((width/2)-300,(height/2)-200,600,400)
text ("Hi! this was originally made by Adamsmashem. \n Arrow keys to move. The rest of instructions are in \nthe game. Feel free to fork and make your own \nlevels!",(width/2)-280,(height/2)-150)
text ("Continue",(width/2)-30,(height/2)+150)
if (mouseX>(width/2)-40&&mouseY>(height/2)+130&&mouseX<(width/2)+20&&mouseY<(height/2)+160) { cursor(HAND)} else {cursor(ARROW)}
if (mouseX>(width/2)-40&&mouseY>(height/2)+130&&mouseX<(width/2)+20&&mouseY<(height/2)+160&&mouseIsPressed) {home=1;cursor(ARROW) }
if (keyIsDown(71)) {home=1}
if (keyIsDown(82)) {level=1; deaths=0;cheated=0;x=20;y=400;xspeed=0;yspeed=0}
if (level==20&&deaths<rec) {rec=deaths; storeItem('rec', rec);}
if (keyIsDown(75)) {rec=99999; storeItem('rec', rec);}
if (rec==null) {rec=99999}
("yay! you finished the platformer!\nplease heart this if you liked it!\nalso check out some of my other sketches ",
moveplat (20,480,70,25,1150,3)
if(keyIsDown(72)) {hack=1}
if(keyIsDown(67)) {coolmode=1}
text ("go to the ball the complete the level",400,100)
plat(95,250,25,450,23, 176, 0)
plat(605,250,25,450,23, 176, 0)
text ("red will kill you",400,300)
spike (500, 510, 300, 35)
text ("Wall jump", 180, 150)
plat(95,250,25,450,23, 176, 0)
plat (420,290,40,25,23, 176, 0)
text ("this level is very difficult", 380, 300)
spike (200, 430, 100,100)
spike (800, 525, 100, 40)
text ("yellow is like a trampoline", 250, 450)
text (("SO MANY TRAMPOLINES"), 500, 480)
text (("there's a wall there, you just can't see it."), 500, 200)
plat (600,300,25,220, 20, 243, 255)
bounce (820, 520, 70, 25)
bounce (820, 420, 70, 25)
plat (0,400,1000,25,23, 176, 0)
plat (200,200,20,350 ,23, 176, 0)
plat (550,200,20,20,23, 176, 0)
plat (750,200,20,20,23, 176, 0)
plat (650,-5,25,85,23, 176, 0)
spike (210, 520, 1000, 10)
plat (250,480,15,10 ,23, 176, 0)
plat (1020,420,15,10 ,23, 176, 0)
plat (670,440,15,10 ,23, 176, 0)
plat (139,518,5,20 ,23, 176, 0)
spike (140, 520, 1000, 10)
moveplat (100,490,70,25,1200,3)
spike (140, 520, 1000, 10)
text ("teleporters", 500, 200)
plat (650-100,250,30,300,
tele (660-125,250, 680-100,
text ("more teleporters", 500, 200)
plat (260-100,250,30,300,23, 176, 0)
plat (470,250,30,300 ,23, 176, 0)
plat (300,0,30,600 ,23, 176, 0)
tele (265-125,250, 500,250, 20, 300, 20, 300)
tele2 (450,250, 280-100,250, 20, 300, 20, 300)
tele3 (800,510, 20,20, 60, 20, 60, 20)
tele4 (1000,20, 800,410, 60, 20, 60, 20)
text ("infinite loop", 500, 200)
teley (500,510, 500,400, 130, 25, 130, 25)
plat (200,400,10,10,23, 176, 0)
plat (300,250,10,10,23, 176, 0)
plat (500,200,10,10,23, 176, 0)
plat (850,450,10,10,23, 176, 0)
spike (210, 520, 1000, 10)
text ("be careful, the colours in this level are inverted", 500, 200)
plat (130, 520, 200, 30, 255, 0, 0)
plat (740, 520, 200, 30, 255, 0, 0)
plat (1100, 520, 200, 30, 255, 0, 0)
spike (140, 520, 1000, 0)
plat (100, 450, 5, 5, 23, 176, 0)
plat (200, 320, 5, 5, 23, 176, 0)
plat (700, 350, 5, 5, 23, 176, 0)
spike (140, 520, 1000, 10)
plat (500,150,200,30, 23,176,0)
{level++; t=0; x=50; y=500;cheated=1;xspeed=0;yspeed=0; deaths++}
line (0,height-10 , width,height-10)
if (keyIsDown(84)) {thumb=1}
if (thumb==1) {image(img, 325, 10)}
if (ground==1) { if (bouncey=0) {speed=0}} else {speed-=-0.75}
if ((keyIsDown(32)||keyIsDown(38)||keyIsDown(87))&&canjump==1) {speed=-15} else {if (touchingGround()) {y=height-34;}}
if (touchingGround()) {y=height-34}
if ((touchingGround())) {ground=1} else {ground=0}
if (ground==1) {canjump=1} else {canjump=0}
if (coolmode==0) {fill (161, 161, 161)
ellipse (115+15,35,30,10)} else{
ellipse (115+15,35,30,10) }
ellipse (107+15,35,15,15)} else {
ellipse (125+15,35,15,15)}
text ("trail mode:",45,40)
text ("level:"+level+" Deaths:"+deaths+" FPS:"+round(getFrameRate()),10,20)
if (rec==99999) {text ("your record:",
text ("your record:"+rec,190,20)
if (keyIsDown(37)||keyIsDown(65)) {if (abs(xspeed)>maxspeed||abs(xspeed)==maxspeed)
{} else {if (canmove==1){xspeed+=-1}}}
if (keyIsDown(39)||keyIsDown(68)) {if (abs(xspeed)>maxspeed||abs(xspeed)==maxspeed)
{} else {if (canmove==1){xspeed+=1}}}
rect(x-16, y-16, 32, 32, 7)
if (xspeed==0){ellipse (x+6.5, y-8,5,5)
ellipse (x-6.5, y-8,5,5)}
if (xspeed<0) {ellipse (x-7,y-7,5,5)}
if (xspeed>0){ellipse (x+7,y-7,5,5)}
if (xspeed<0) {line(x-15,y+7,x-10,y+6);
if (xspeed>0) { line(x+15,y+7,x+10,y+6);
if (xspeed<0) {xspeed+=0.5}
else {if (xspeed>0){xspeed-=0.5}}
textAlign(CENTER,CENTER);
if(mouseY>height-50){fill(999)
rect(0,height-50,width,50)
function touchingGround () {
if (y>height-35) {return (true)} else {return (false)}
function plat (x2,y2,w2,h2,color, color2, color3) {
fill (color,color2,color3)
if(x>x2-17.5&&x<x2+w2+17.5&&(y>y2-17.5&&y<y2+5)) {y=y2-17.5;
ground=1; canjump=1; speed=0; onplat=1}
else {if (t3>30) {onplat=0; t3=0} }
if (x>x2-17.5&&x<x2+w2+17.5&&(y>y2+17.5&&y<y2+h2+20.5))
{speed=1;onplat=1} else {if (t3>30) {onplat=0; t3=0} }
if(x>x2-17.5&&x<x2+w2-5&&(y>y2-17.5&&y<y2+h2+5))
{x=x2-17.4;onplat=1} else {if (t3>30) {onplat=0; t3=0} }
if(x>x2-17.5&&x<x2+w2-5&&(y>y2-17.5&&y<y2+h2+5)&&
keyIsDown(38)&&(keyIsDown(39))) {speed=-7; xspeed=-7; canjump=1;onplat=1}
else {if (t3>30) {onplat=0; t3=0} }
if(x<x2+w2+15&&x>x2+5&&(y>y2-17.5&&y<y2+h2+5)&&
keyIsDown(38)&&(keyIsDown(37))) {speed=7; xspeed=7; canjump=1;onplat=1}
else {if (t3>30) {onplat=0; t3=0} }
if(x<x2+w2+15&&x>x2+5&&(y>y2-17.5&&y<y2+h2+5)) {x=x2+w2+17.5}
function spike (x2,y2,w2,h2) {
if(x>x2-17.5&&x<x2+w2+17.5&&(y>y2-17.5&&y<y2+h2)&&hack==0) {x=50; y=500; deaths++}
function spikecir (x2,y2,r2) {
if(abs(x-x2)<r2 && abs(y-y2)<r2&&hack==0) {x=50; y=500; deaths++}
function finish (x2,y2,r2) {
if(abs(x-x2)<r2 && abs(y-y2)<r2) {x=50; y=500; level++; xspeed=0; speed=0; if (coolmode==1)
{background(20, 243, 255)}}
function bounce (x2,y2,w2,h2) {
if(x>x2-17.5&&x<x2+w2+17.5&&(y>y2-17.5&&y<y2+h2)) {speed=-21; bouncey=1} else {if (t2>20)
if (x>x2-17.5&&x<x2+w2+17.5&&(y>y2+17.5&&y<y2+h2+20.5)) {speed=21; bouncey=1} else {if (t2>20)
if(x>x2-17.5&&x<x2+w2-5&&(y>y2&&y<y2+h2+5)) {xspeed=-21; bouncey=1} else {if (t2>20)
if(x<x2+w2+15&&x>x2+5&&(y>y2&&y<y2+h2+5)) {xspeed=21; bouncey=1} else {if (t2>20)
if (keyIsDown(38)) {} else {if (touchingGround()) {if (x>x2-17.5&&x<x2+w2+17.5&&
(y>y2-17.5&&y<y2+h2)){speed=-21} else {if (t5>20) {speed=0 ;t5=0}}}}
function mousePressed() {
if (mouseX>114&&mouseX<145&&mouseY>30&&mouseY<40) {
if (coolmode==0) {coolmode=1} else {coolmode=0}
function moveplat (x2, y2, w2, h2,r2,s2){
plat (x3,y2,w2,h2 ,23, 176, 0)
if (x22>0) {if (x>x3-17.5&&x<x3+w2+17.5&&(y>y2-23&&y<y2+5)||x>x3-17.5&&x<x3+w2+17.5&&
(y>y2+17.5&&y<y2+h2+20.5)||
x>x3-17.5&&x<x3+w2-5&&(y>y2-17.5&&y<y2+h2+5)||x<x3+w2+15&&x>x3+5&&(y>y2-17.5&&y<y2+h2+5))
if (x22<0) {if (x>x3-17.5&&x<x3+w2+17.5&&(y>y2-23&&y<y2+5)||x>x3-17.5&&x<x3+w2+17.5&&
(y>y2+17.5&&y<y2+h2+20.5)||
x>x3-17.5&&x<x3+w2-5&&(y>y2-17.5&&y<y2+h2+5)||x<x3+w2+15&&x>x3+5&&(y>y2-17.5&&y<y2+h2+5))
if (x>x3-17.5&&x<x3+w2+17.5&&(y>y2-17.5&&y<y2+5)||x>x3-17.5&&x<x3+w2+17.5&&
(y>y2+17.5&&y<y2+h2+20.5)||
x>x3-17.5&&x<x3+w2-5&&(y>y2-17.5&&y<y2+h2+5)||x<x3+w2+15&&x>x3+5&&(y>y2-17.5&&y<y2+h2+5))
{onmoveplat=1} else{if (t4>30) {onmoveplat=0; t4=0}}
function tele (x2,y2,x3,y3,w2,h2,w3,h3) {
if(x>x3-17.5&&x<x3+w2+17.5&&(y>y3-17.5&&y<y3+h2+17.5)) {
if (xspeed<0) { x+=(x2-x3-w2)}
if (xspeed==0) { x+=(x2-x3)}
if (xspeed>0) { x+=(x2-x3+w2)} y+=(y2-y3)
if(x>x2-17.5&&x<x2+w2+17.5&&(y>y2-17.5&&y<y2+h2+17.5)) {
if (xspeed<0) { x+=-(x2-x3+w3)}
if (xspeed>0) { x+=-(x2-x3-w3)}
if (xspeed==0) { x+=-(x2-x3)}
if((x>x2-17.5&&x<x2+w2+17.5&&(y>y2-17.5&&y<y2+h2+17.5))||
(x>x3-17.5&&x<x3+w2+17.5&&(y>y3-17.5&&y<y3+h2+17.5)))
function tele2 (x2,y2,x3,y3,w2,h2,w3,h3) {
if(x>x3-17.5&&x<x3+w2+17.5&&(y>y3-17.5&&y<y3+h2+17.5)) {
if (xspeed<0) { x+=(x2-x3-w2)}
if (xspeed==0) { x+=(x2-x3)}
if (xspeed>0) { x+=(x2-x3+w2)} y+=(y2-y3)
if(x>x2-17.5&&x<x2+w2+17.5&&(y>y2-17.5&&y<y2+h2+17.5)) {
if (xspeed<0) { x+=-(x2-x3+w3)}
if (xspeed>0) { x+=-(x2-x3-w3)}
if (xspeed==0) { x+=-(x2-x3)}
if((x>x2-17.5&&x<x2+w2+17.5&&(y>y2-17.5&&y<y2+h2+17.5))||
(x>x3-17.5&&x<x3+w2+17.5&&(y>y3-17.5&&y<y3+h2+17.5)))
function teley (x2,y2,x3,y3,w2,h2,w3,h3) {
if(x>x3-17.5&&x<x3+w2+17.5&&(y>y3-17.5&&y<y3+h2+17.5)) {
if(x>x2-17.5&&x<x2+w2+17.5&&(y>y2-17.5&&y<y2+h2+17.5)) {
if((x>x2-17.5&&x<x2+w2+17.5&&(y>y2-17.5&&y<y2+h2+17.5))||
(x>x3-17.5&&x<x3+w2+17.5&&(y>y3-17.5&&y<y3+h2+17.5)))
function tele3 (x2,y2,x3,y3,w2,h2,w3,h3) {
if(x>x3-17.5&&x<x3+w2+17.5&&(y>y3-17.5&&y<y3+h2+17.5)) {
if (xspeed<0) { x+=(x2-x3-w2)}
if (xspeed==0) { x+=(x2-x3)}
if (xspeed>0) { x+=(x2-x3+w2)} y+=(y2-y3)
if(x>x2-17.5&&x<x2+w2+17.5&&(y>y2-17.5&&y<y2+h2+17.5)) {
if (xspeed<0) { x+=-(x2-x3+w3)}
if (xspeed>0) { x+=-(x2-x3-w3)}
if (xspeed==0) { x+=-(x2-x3)}
}}}if((x>x2-17.5&&x<x2+w2+17.5&&(y>y2-17.5&&y<y2+h2+17.5))||
(x>x3-17.5&&x<x3+w2+17.5&&(y>y3-17.5&&y<y3+h2+17.5))){}else{st3=0;}
function tele4 (x2,y2,x3,y3,w2,h2,w3,h3) {
if(x>x3-17.5&&x<x3+w2+17.5&&(y>y3-17.5&&y<y3+h2+17.5)) {
if (xspeed<0) { x+=(x2-x3-w2)}
if (xspeed==0) { x+=(x2-x3)}
if (xspeed>0) { x+=(x2-x3+w2)} y+=(y2-y3)
if(x>x2-17.5&&x<x2+w2+17.5&&(y>y2-17.5&&y<y2+h2+17.5)) {
if (xspeed<0) { x+=-(x2-x3+w3)}
if (xspeed>0) { x+=-(x2-x3-w3)}
if (xspeed==0) { x+=-(x2-x3)}
}}}if((x>x2-17.5&&x<x2+w2+17.5&&(y>y2-17.5&&y<y2+h2+17.5))||
(x>x3-17.5&&x<x3+w2+17.5&&(y>y3-17.5&&y<y3+h2+17.5))){}else{st4=0;}