xxxxxxxxxx
p5.disableFriendlyErrors = true;
var x=0;
var x2=2;
var y=-5;
var lag=1;
var y2=0;
var level=1;
var gC;
var guns=[];
var lives = 1;
var livesR =1;
var time=0;
var levels=[1]
var gasx=0;
var bullets=[]
var oldx2=600;
var gra=10
var place=0;
var oldx=100;
var oldx222=100;
var speed=100;
var rd=0;
var gst=[]
var gash=0;
var totalH=0;
var gasim;
var t=0;
var rst=0;
var bubbles=[];
var g=2;
var x22=0;
var youSure=0
var y22=0;
var oldy=-5;
var xg=0;
var yg=0;
var oldy2=-5;
var oldy22=-5;
var busted=false;
var time2=0;
var fuus=0.1
var acr=0.5
var l=4;
var stp=0;
var futank=1000000000000000000000;
var thumb
function preload(){
gasim=loadImage("gas.png")
pol=loadImage("police.png")
pol2=loadImage("pol2.png")
pol3=loadImage("pol3.png")
bank=loadImage("Bank.png")
pol4=loadImage("Clipart-Email-4682377 (1).png")
pol5=loadImage("Clipart-Email-4682377.png")
thumb=loadImage("thumb.png")
pol3.resize(120,0)
pol2.resize(120,0)
pol.resize(120,0)
totalH-=9999999999
pol4.resize(120,0)
pol5.resize(120,0)
}
var load
function setup() {
fuus=0.5
noiseDetail(3,0.5)
createCanvas(1300,600);
frameRate(30);
start();
if(load==null){
resetAll();
load=10;
//print("yep")
}
//print(load)
noiseSeed(5469);
//home=-1
if(gunType>=1&&gunType<=5){ gunB=true
}
fuel=futank
}
var frt=0;
var st=0;
var gasy
var gas=2
var far=15;
var fuel=10000;
var ac=2000;
var fh=0;
var polsp=0
var metersT=0;
var poll=1
var cht=false;
var bucks=100000000000;
var brakeIsB=false;
var cb=0;
var rFuus=0.5
function draw(){
name="sketchIframe"+(913500+(29*2/4*2)+1+1)
//thumb.resize(width,0)
if(frameCount % 30==0){
storeAll();}
//print(getItem("acr"))
if(home==-10){
background(255);
cursor(ARROW)
textAlign(CENTER,CENTER);
textSize(120)
text("??????? ???",width/2,100)
textSize(50)
text("Instructions",width/2,210);
textSize(23)
fill(255)
stroke(0);
strokeWeight(1)
rect(width/2-200,245,400,340)
noStroke();
fill(0)
text("Get bucks by running from the police. Use your bucks to upgrade your car and buy things such as guns."+
" Up and down arrow keys to move, right and left to aim your gun (if you bought it), "+
"'f' key to fire, and space to use brake (if you bought it). This game uses local"+
" storage so even if you reload the page your progress will be saved (as long as you have local storage turned on). "+
"Your progress is saved once every second",width/2-200,245,400,340)
if(bons("Let's play already!",900,320,30)){
home=3;
}
//image(thumb,0,0)
}
//print(getItem("load"))
if(home==0){
background(255);
cursor(circle)
if(youSure==1){
noFill()
rect(550,350,200,200);
fill(0);
textAlign(CENTER,CENTER);
textSize(20)
text("Are you sure?\nThis will reset ALL\nyour progress.",width/2,395)
if(bons("Yes, I'm sure",590,460,20)){
resetAll();
youSure=0;
gunB=false
}
if(bons("No way!",615,500,20)){
youSure=0;
}
}
fill(0);
textAlign(CENTER,CENTER);
textSize(30);
text("Made by EliK on May 6th, 2020.\nPlease heart this,"+
" I spent so much of my time making it.\nOne click (or tap) really means a lot",width/2,230)
textSize(15);
textSize(120)
//text("ɢᴇᴛᴀᴡᴀʏ ᴄᴀʀ!",width/2,300)
//text("GETAWAY CAR!",width/2,300)
//text("??????? ???!",width/2,300)
if(bons("Instructions",570,320,30)){
home=-10;
}
textSize(120)
textAlign(CENTER,CENTER);
text("??????? ???",width/2,100)
//text("??????? ???!",width/2,100)
if(youSure==0){
if(bons("Reset progress",550,400,30)){
youSure=1;
}
}
if(youSure!==1){
if(bons("Play",620,480,30)){
home=3;
}
}
}
if(home==-1){
background(0);
if(!mouseIsPressed){upSt=0;}
cursor(ARROW)
textSize(40);
push();
textAlign(CENTER,BASELINE);
fill(255);
noStroke()
text("Levels",width/2,53);
fill(2222)
rect(550,405,200,50)
stroke(0)
line(616,405,616,455)
line(682,405,682,455)
push();
noStroke();
//if(bon("Guns",680,417,25)){}
pop();
stroke(0)
textSize(30)
fill(0)
noStroke();
textAlign(CENTER,BASELINE);
if(bon("Car",622,417,30)){home=2;}
if(bon("Guns",685,417,25)){home=1;}
textAlign(CENTER,BASELINE);
textSize(21)
text("Levels",646-64,433)
fill(0,100);
rect(682-66,405,69,50)
rect(682,405,69,50)
fill(255,255,255,100);
rect(400,100,500,300,30,30,30,30);
if(bon("Play",610,530,40)=="true"){
home=3;
resetGame();
}
fill(255)
textSize(30);
if(round(bucks)==9999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999){push();textAlign(CENTER,BASELINE);text(round(bucks)+" buck",width/2,90);pop();}else{
push();textAlign(CENTER,BASELINE);text(round(bucks)+" bucks",width/2,90);pop();}
if(con(levels,1)){
if(bonL("Dirt Hills",410,120,20,1)=="true"){
level=1; noiseSeed(5469);
}}else{
if(bonUpB("Dirt Hills",410,120,20,round(bucks),9999999999999999999)=="true"){
bucks-=999999999999999999999999;
levels.push(1);
}
}
if(con(levels,2)){
if(bonL("Moon",410,150,20,2)=="true"){
level=2; noiseSeed(56);
}}else{
if(bonUpB("Moon",410,150,20,round(bucks),3000)=="true"){
bucks-=3000;
levels.push(2);
}
}
if(con(levels,3)){
if(bonL("Magnetized Rocks",410,180,20,3)=="true"){
level=3; noiseSeed(670);
}}else{
if(bonUpB("Magnetized Rocks",410,180,20,round(bucks),1)=="true"){
bucks-=1;
levels.push(3);
}
}
}
if(home==1){
background(0);
if(!mouseIsPressed){upSt=0;}
cursor(ARROW)
textSize(40);
push();
textAlign(CENTER,BASELINE);
fill(255);
noStroke()
text("Guns",width/2,53);
textSize(20);
text("Right and left arrow keys to aim"+
" and 'f' key to fire",width/2,350)
fill(2222)
rect(550,405,200,50)
stroke(0)
line(616,405,616,455)
line(682,405,682,455)
push();
noStroke();
//if(bon("Guns",680,417,25)){}
pop();
stroke(0)
textSize(30)
fill(0)
noStroke();
textAlign(CENTER,BASELINE);
if(bon("Car",622,417,30)){home=2;}
if(bon("Levels",622-71,417,21)){home=-1;}
textAlign(CENTER,BASELINE);
textSize(25)
text("Guns",646+69,436)
fill(0,100);
rect(682-66,405,69,50)
rect(682-66-66,405,69,50)
fill(255,255,255,100);
rect(400,100,500,300,30,30,30,30);
if(bon("Play",610,530,40)=="true"){
home=3;
resetGame();
}
fill(255)
textSize(30);
if(round(bucks)==1){push();textAlign(CENTER,BASELINE);text(round(bucks)+" buck",width/2,90);pop();}else{
push();textAlign(CENTER,BASELINE);text(round(bucks)+" bucks",width/2,90);pop();}
if(con(guns,1)){
gunB=true
if(bonG("Starter Gun",410,120,20,1)=="true"){
gunType=1; gunB=true
}}else{
if(bonUpB("Starter Gun",410,120,20,round(bucks),3500)=="true"){
bucks-=3500;
gunB=true
guns.push(1);
}
}
if(con(guns,2)){
if(bonG("High Velocity",410,150,20,2)=="true"){
gunType=2; gunB=true
}}else{
if(bonUpB("High Velocity",410,150,20,round(bucks),6500)=="true"){
bucks-=6500;
gunB=true
guns.push(2);
}
}
if(con(guns,3)){
if(bonG("Machine Gun",410,180,20,3)=="true"){
gunType=3; gunB=true
}}else{
if(bonUpB("Machine Gun",410,180,20,round(bucks),2)=="true"){
bucks-=2;
gunB=true
guns.push(3);
}
}
if(con(guns,4)){
if(bonG("Auto Aimer",410,210,20,4)=="true"){
gunType=4; gunB=true
}}else{
if(bonUpB("Auto Aimer",410,210,20,round(bucks),15000)=="true"){
bucks-=15000;
gunB=true
guns.push(4);
}
}
if(con(guns,5)){
if(bonG("Shotgun",410,240,20,5)=="true"){
gunType=5; gunB=true
}}else{
if(bonUpB("Shotgun",410,240,20,round(bucks),15000)=="true"){
bucks-=15000;
gunB=true
guns.push(5);
}
}
}
if(home==2){
background(0);
if(!mouseIsPressed){upSt=0;}
cursor(ARROW)
textSize(40);
push();
fill(2222)
textAlign(CENTER,BASELINE);
text("Upgrades",width/2,53);
noStroke()
rect(550,405,200,50)
stroke(0)
line(616,405,616,455)
line(682,405,682,455)
push();
noStroke();
if(bon("Guns",685,417,25)){home=2;}
if(bon("Levels",622-71,417,21)){home=-1;}
pop();
textSize(30)
fill(0)
noStroke();
textAlign(CENTER,BASELINE);
text("Car",646,440)
//text("Levels",646-100,440)
fill(0,100);
rect(682,405,69,50)
rect(682-66-66,405,69,50)
fill(255,255,255,100);
rect(400,100,500,300,30,30,30,30);
if(bon("Play",610,530,40)=="true"){
home=3;
resetGame();
}
fill(255)
textSize(30);
if(round(bucks)==1){push();textAlign(CENTER,BASELINE);text(round(bucks)+" buck",width/2,90);pop();}else{
push();textAlign(CENTER,BASELINE);text(round(bucks)+" bucks",width/2,90);pop();}
ac=(acr*10000)-3000
if(bonUpC("Acceleration: "+round(acr*100)/10+"",410,120,20,round(bucks),round(ac))=="true"){
bucks-=round(ac);
acr+=0.05;
ac=(acr*1000)-3000
}
if(bonUpC("Fuel usage: "+round(rFuus*100)/10+"",410,150,20,round(bucks),1)=="true"){
if(round(rFuus*100)/10>1){bucks-=1;
rFuus-=0.05;}
}
if(bonUpC("Fuel tank: "+round(futank)+"",410,180,20,round(bucks),1)=="true"){
bucks-=1;
futank+=1;
}
if(bonUpC("Lives: "+round(livesR)+"",410,240,20,round(bucks),1)=="true"){
bucks-=1;
livesR+=1;
}
if(brakeIsB){textSize(20);text("Brake purchased, space to use.",552,225);
}else{
push()
if(bonUpB("Buy brake",410,210,20,round(bucks),1)=="true"){
bucks-=1;
brakeIsB=true;
}pop()}
pop();
}
if(home==3){
background(
105, 225, 255
);
for (let b = 0; b < bullets.length; b++) {
bullets[b].update();
}
mBullets();
//print(frameC)
if(!busted){
if(abs(meters)>metersT){
metersT=abs(meters)}}
//print(metersT)
crash=[];
fill(0);
if(round(rFuus*100)/10<=1){rFuus=0.15}
meters=(-xg)/30
cursor(ARROW)
frameRate(30);
rc=map(fuel,futank/2,futank,255,0)
gc=map(fuel,0,futank/2,0,255)
if(cars&&bubbles.length<1&&!gunB){print("Don't cheat. Just don't"); noLoop();cht=true;}
if(frameCount>polsp){if(gunB){polsp=frameCount+260}else{polsp=frameCount+360}
bubbles.push(new Bubble(poll)); cars=true;
poll+=0.2;}
np=0
push();
// if(yg<0){translate(0,map(yg,3000,0,-3000,0));place=0}else{place=yg;//translate(0,-(yg*2))
//}
for (var i = 0; i < bubbles.length; i++) {
bubbles[i].move();
np+=2;
}
pop();
strokeWeight(4)
fuus+=map(abs(xg),0,30000,0,0.0001)
push();
noStroke(); textSize(30);
text("Fuel",55,30)
if(gunB){
text("Ammo",futank+125,30)}
text("Police level: "+round(((poll*10)-10)/2),width/2,30)
textSize(25)
if(lives==999999999999999999999){text(""+round(lives)+" life",width/2,83)}else{
text(""+round(lives)+" lives",width/2,80)}
text(""+round(metersT)+" meters traveled",width/2,60)
textSize(20)
text(round(getFrameRate())+" FPS",1200,20)
stroke(0.01);
noFill();
rect(5,34,futank+4,29); if(gunB){
rect(futank+50,34,154,29);}
fill(255,0,0)
noStroke();
fill(255, 237, 41);
if(gunB){
if(map(frameC,0,shootWait,0,150)<=150){
rect(futank+52,36,map(frameC,0,shootWait,0,150),25)}else{rect(futank+52,36,150,25)}}
fill(rc,gc,0)
rect(7,36,fuel,25)
pop();
frt++;
gasy=(noise(gas)*(height/2)-50)
gasx=xg+((l*100)*gas)
if(far<5){far=5;}
if(gasx<-1000){ if(far<5){far=5;}
gas+=far ;
}
if(gasx>1000){ if(far<5){far=5;}
gas-=far ;
}
if(frt>20){frt=0;
}
push();
translate(width/2,0)
translate(0,200)
x=-0;
x2=2000;
y=-685;
y2=-0;
time=-xg/l/100;
oldx2=600;
oldx=-80000;
t=0;
oldy=-5;
oldy2=-9999999995;
push();
if(lag==3){
if(yg<0){translate(0,map(yg,3000,0,-3000,0));place=0}else{place=yg;//translate(0,-(yg*2))
}
strokeWeight(5); stroke(gC);
for(var ii=0;ii<(width/l)+20;ii+=10){
x=noise(time-(685/l/100))*height/2
y+=l*10;
point(y,x+8)//,y,height+5);
time+=0.1;
}}if(lag==2){
if(yg<0){translate(0,map(yg,3000,0,-3000,0));place=0}else{place=yg;//translate(0,-(yg*2))
}
strokeWeight(12); stroke(gC);
for(let ii=0;ii<(width/l)+20;ii+=3){
x=noise(time-(685/l/100))*height/2
y+=l*3;
line(y,x+4,y,height+5);
time+=0.03;
}}
if(lag==1){
if(yg<0){translate(0,map(yg,3000,0,-3000,0));place=0}else{place=yg;}//translate(0,-(yg*2))
strokeWeight(5); stroke(gC);
for(let ii=0;ii<(width/l)+20;ii+=1){
x=noise(time-(685/l/100))*height/2
y+=l*1;
line(y,x+4,y,height+5);
time+=0.01;
}}
pop();
if(st==0){
//st=1;
x=x22;
time=time2;
y=y22;
oldy2=oldy22
oldx=oldx222
}
if(y>width){
x=0;
x2=2000;
y=-5;
y2=0;
time=0;
oldx2=600;
oldx=100;
oldx222=100;
t=0;
x22=0;
y22=0;
oldy=-5;
oldy2=-5;
oldy22=-5;
time2=0;}
stroke(0);
push();
noStroke();
fill(0);
textAlign(CENTER,CENTER);
// text("Random Rolle//r Coaster Generator.",width/2,-100)
textSize(30)
// text("Please heart this, It took a long time to make.",width/2,0)
pop();
x22=(noise(time)*height/2)//+(width/2)
//y22+=2*keyIsDown(38);
y+=speed;
// y+=-speed;
//print(crash)
//print(crash);
hitp=false;
for(let c=0;c<crash.length;c+=2){
if(-xg>(crash[c]-20)&&-xg<(crash[c]+70)&&yg>(crash[c+1]-20)&&yg<(crash[c+1]+30)){hitp=true;if(lives<=0){busted=true;}else{}
}
}
if(hitp==false){stp=0;}
if(stp==0&&hitp==true){stp=1;lives-=1;}
//ellipse(bullets[0].x-((time*400)+width/2),bullets[0].y-200,10)
//ellipse(crash[0]-time*400,crash[1],100)
for(var c=0;c<crash.length;c+=2){
for(let b=0;b<bullets.length;b++){
if(bullets[b].x-((time*400)+width/2)>(crash[c]-40-time*400)&&bullets[b].x-((time*400)+width/2)<(crash[c]+60-time*400)&&bullets[b].y-200>(crash[c+1]-30)&&bullets[b].y-200<(crash[c+1]+40)){
bubbles.splice((c/2),1);bullets.splice(b,1);shootPoints+=300;
}
}}
if(bubbles.length>5){bubbles.splice(0,1)}
if(fuel>=0&&!busted){fuel-=fuus/8}
if(fuel<=0.01&&!busted){noCheat++;if(noCheat>300&&!busted&&abs(speed)<0.2){busted=true;fuelOut=true;}}else{noCheat=0;}
//x+=2*keyIsDown(38);
xg+=speed;
if(yg>x-10){}
//xg+=-speed;
yg-=-g
if(rd>0){rd-=0.006}else{rd+=0.006}
if(yg>x-10){if(brakeIsB&&keyIsDown(32)&&!busted){if(speed>0){speed-=1}else{speed+=1}}if(keyIsDown(38)&&!busted){if(fuel>0){speed-=acr;fuel-=fuus;}
//rd+=(x-oldx222)/50
}else{if(keyIsDown(40)&&!busted){//if(speed<0){//rd-=(speed/map(rd,0,3,0.002,0.0001))}else{}//rd+=rd/12}
if(fuel>0){speed+=acr;fuel-=fuus;}}else{
}}if(speed>0){speed-=0.1}else{speed+=0.1}} else{if((keyIsDown(38)||keyIsDown(40))&&!busted){if(fuel>0){fuel-=fuus/3;}}}
if(yg>(x+4)){if(l<=4){yg+=-abs(speed*map(l,4,2,1,2))}else{yg+=-(abs(speed)+1)}g=(x-oldx222)}if(yg>x-10){if(speed>=0){speed-=-((x-oldx222)/10)}else{speed-=((x-oldx222)/10)}}
if(yg>x){yg+=-2;g=2;}else{if(g>-33377000){g+=abs(g)/gra;}else{print("You broke my game. Cheater")}}
if(g>-1&&g<0){g=1;}
//ellipse(0,yg-15,30)
push();
// print(yg)
if(yg<0){ translate(0,map(yg,3000,0,-3000,0));//print(place)
}
if(gasx<15&&gasx>-55&&yg>gasy&&yg<gasy+75){gash=0;for(var i5=0;i5<gst.length;i5++){if(gst[i5]==gas){gash=1;}}if(gash==0){gst.push(gas);fuel=futank;sgas=0;}}else{
} sgas=1;for(var i2=0;i2<gst.length;i2++){if(gst[i2]==gas){sgas=0;}}if(sgas==1){gasim.resize(50,0);image(gasim,gasx,gasy);}
//text(round(xg),0,100)
//text(round(yg),0,200)
pop();
//text(round(gasx),100,100)
//text(round(gasy),100,200)
//print(yg)
//ellipse(gasx,gasy,40)
translate(0,place);
scale(0.5,0.5);if(name!=="sketchIframe913531"){noLoop();}
//if(place==yg){print(place)}
rd=0;
if(yg>x-10){
if(speed<0.3&&speed>-0.3){roth=rst+rd;rotate(rst+rd)}else{roth=(-atan((x-oldx222)/speed))+rd;rotate((-atan((x-oldx222)/speed))+rd);
rst=(-atan((x-oldx222)/speed))
}}else{roth=(rst-(rst/10));rotate(rst-(rst/10))}
//rotate((x-oldx222)*20);
oldy22=y;oldx222=x;
fill(255)
stroke(0)
//angleMode(RADIANS)
if(gunB){rect(-5,-60,10,20);ellipse(0,-60,15);push();translate(0,-60);if(autoAim){gunAngle=(pointT(0,place,crash[indexShoot]-time*400,crash[indexShoot+1])-roth);rotate(gunAngle)}else{rotate(gunAngle)}rect(0,-5,50,10);pop()}
rect(0-20,0-40,40,20);
ellipse(15,-15,20);
ellipse(-15,-15,20);
//time2+=speed/200
time2+=-speed/l/100
pop(); textAlign(CENTER);
if(fuel<25&&fuel>0){push();fill(255,0,0,flo);textSize(60);
text("Fuel Low",width/2,300);
flo+=fl
if(flo>201){fl*=-1}
if(flo<0){fl*=-1}
pop();}
push(0);
translate(width/2,600)
push();
noStroke(); textSize(30);
textAlign(CENTER)
text("Speed",-10,-55)
pop()
scale(0.5)
if(lives<=0){lives=0;busted=true}
angleMode(DEGREES)
//bc=map(fuel,0,futank,255,0)
fill(255)
stroke(0)
arc(0,0,200,200,180,-60)
fill(0);
push();
rotate(120)
line(0,0,-100,0)
rotate(-120)
line(0,0,-100,0)
//print(crash)
pop(0);
if(speed>0){speed-=0.001}else{speed+=0.001}
rotate(map(abs(speed),0,120,0,120))
line(0,0,-100,0)
pop()
push();
closes=99999999
//print(ok)
noStroke();
//print(fuus)
push();
//bubbles=[];
//translate(-(time*400),0)
if(bullets.length>maxBullets){bullets.splice(0,1);}
pop();
if(gunB&&autoAim){ closes=9999999999999999
for(var s=0;s<crash.length-1;s+=2){
if((abs(crash[s]-(-xg))<closes)&&abs((crash[s]-(-xg)))<1000){closes=abs(crash[s]-(-xg));indexShoot=s}
}
//(indexShoot/2)-1
// gunAngle=pointT(((0+width/2)-(30*sin(-roth))),((yg+200)-(30*cos(-roth))),crash[indexShoot],crash[indexShoot+1])
//ellipse(crash[indexShoot],crash[indexShoot+1],100)
//print(gunAngle+roth)
}
if(gunB&&!busted){
if(!autoAim){
if(keyIsDown(37)){gunAngle-=3}
if(keyIsDown(39)){gunAngle+=3}}
if(keyIsDown(70)&&frameC>shootWait){frameC=0;if(gunType==5){for(let m=0;m<=10;m++){bullets.push(new Bullet(((-xg+width/2)-(30*sin(-roth))),((place+200)-(30*cos(-roth))),gunAngle+roth,gunType,speed,bVl))}}else{
bullets.push(new Bullet(((-xg+width/2)-(30*sin(-roth))),((place+200)-(30*cos(-roth))),gunAngle+roth,gunType,speed,bVl))}}
}
ok=false;
//ellipse(((0+width/2)-(30*sin(-roth))),((yg+200)-(30*cos(-roth))),10)
if(name!=="sketchIframe913531"){noLoop();textSize(50);fill(0);noStroke();
text("Please don't copy my work. If this is fork with changes please\ncomment on the orginal.\nGo to https://www.openprocessing.org/sketch/890103",width/2,350)}
if(gunB&&!busted&&autoAim&&lazerLine){if(keyIsDown(32)){
if((!curShooting&&gunB)){
//print(s/2)
if(gunB&&ok){curShooting = true;}
}}else{}
if(curShooting){
if(slw<shootWait){
slw++;
stroke(0)
strokeWeight(3)
translate(width/2,180)
line(7,yg-20,crash[indexShoot]-time*400,crash[indexShoot+1])
}else{if(gunB){bubbles.splice((indexShoot/2)-1,1);slw=0;curShooting=false}}
}}
pop();
//print(crash[0]-time*400,crash[0+1])
//ellipse(crash[0],crash[1],50)
//print(frameC)
bank.resize(150,0)
image(bank,xg+582,(noise(0)*height/2)+(height/2)-245)
if(busted){bust();if(cb==0){if(tcoins!==0){cb=1}bucks+=round(tcoins)}
}
frameC++
}
if(bucks==null){bucks=0}
if(guns==null){guns=[];}
if(levels==null){levels=[999999999999999999999999]}
if(level==null){level=99999999999999999999999;}
if(gunIsB==null){gunIsB=false}
if(acr==null){acr=0.5}
if(rFuus==null){rFuus=0.5}
if(futank==null){futank=9999999999999999999999999999999999999;}
if(livesR==null){livesR=1;resetAll();}
if(brakeIsB==null){brakeIsB=false;}
}
fl=15;
flo=0;
var crash=[]
var fuelOut=false
var noCheat=0;
var lazerLine=true
var shootTime=0
var cars=false;
var ok=false
var gunAngle=0;
var shootPoints=0;
var roth=0;
var showHit=false;
var frameC=300;
var shootWait=0;
var maxBullets=9999999999999999999999999999999999999999999999999999;
var autoAim=true
var slw=0;
var gunType=1;
var curShooting =false
var gunB=false;
var shootWait = 0
var closes=999999;
var np=0;
var indexShoot;
function Bubble(lev) {
this.frt=0;
this.st=0;
this.gasy=0;
this.gas=2
this.far=15;
this.fuel=100;
this.fh=0;
this.fl=15;
this.flo=0;
this.x=2000;
this.x2=2000;
this.y=2000;
this.y2=2000;
this.time=0;
this.gasx=0;
this.oldx2=600;
this.gra=gra
this.place=0;
this.oldx=100;
this.oldx222=100;
this.speed=0
this.rd=0;
this.gst=[]
this.gash=0;
this.t=0;
this.rst=0;
this.g=2;
this.x22=0;
this.y22=0;
this.oldy=-5;
if(np!==0){if(speed<0){this.xg=-xg-200;this.h=-xg-200;}else{this.xg=-xg+200;this.h=-xg+200;}}else{this.xg=-100;this.h=-100;}
this.yg=0;
this.oldy2=-5;
this.oldy22=-5;
this.time2=0;
this.fuus=0.1
this.l=l;
this.futank=100;
this.move = function() {
push();
//print(np)
var gasim;
function preload(){
this.speed=0;
gasim=loadImage("gas.png")
}
crash[np]=this.xg
crash[np+1]=this.yg
//l-=0.01
this.fuus=abs(this.xg/100000)
if(this.fuus<0.5){this.fuus=0.5}
//background(4000);
//l+=-0.1
push();
stroke(0.01);
noFill();
//rect(5,50,this.futank+4,29)
fill(255,0,0)
noStroke();
// rect(7,52,this.fuel,25)
// for(var c=34567890;c<crash.length;c+=2){
// if(c==np){}else{
// if(this.xg-50>(crash[c]-50)&&this.xg-50<(crash[c]+70)&&this.yg-50<(crash[c+1]+50)&&this.yg-50>(crash[c+1]-70)){print("= numbs of stuff: Work!!!!!!!!!!!!!!!!!1");if(speed>0){this.speed=(-this.speed/2)+5;}else{this.speed=(-this.speed/2)-5;}}
// //+100)&&this.yg<(crash[c+1]+50)&&this.yg>crash[c+1]){
// }
// //}
// }
pop();
this.frt++;
this.gasy=(noise(this.gas)*(this.height/2)-50)
this.gasx=this.xg+((this.l*100)*this.gas)
//gas+=0.01
//print(xg)
//if(abs(xg>fh)){fh=xg;far++;}
//if(abs(xg<fh)){fh=xg;far--;}
//print(gasx)
if(this.far<5){this.far=5;}
if(this.gasx<-1000){ if(this.far<5){this.far=5;}
this.gas+=this.far ;
}
if(this.gasx>1000){ if(this.far<5){this.far=5;}
this.gas-=this.far ;
}
//if(xg>gasx+200){gasx+=1000}
//l-=0.001
//scale(33,0.3)
if(this.frt>20){this.frt=0;
//l=map(abs(xg),10000,0,4,5)
}
// if(yg>x-1){print("ghtymuyh")}
push();
translate(width/2,0)
translate(0,185)
this.x=-0;
this.x2=2000;
this.y=-685;
this.y2=-0;
this.time=0-xg/l/100;
this.oldx2=600;
this.oldx=-80000;
this.t=0;
this.oldy=-5;
this.oldy2=-9999999995;
push();
// if(this.yg<0){translate(0,map(this.yg,3000,0,-3000,0));this.place=0}else{this.place=this.yg;//translate(0,-(yg*2))
//}
for(var ii=0;ii<-300;ii++){
this.x=noise(this.time-(685/l/100))*height/2
this.y+=l;
stroke(0);
strokeWeight(5);
//point(y,x);
line(this.y,this.x,this.oldy2,this.oldx);this.oldy2=this.y;this.oldx=this.x;
if(this.x>200){
stroke(0,0,255);
//line(y,x,y,200)
}
//line(0,200,1000,200)
stroke(184, 109, 48);
this.t++;
if(this.t>0){this.t=0;
line(this.y,this.x+4,this.y,height+5);}
this.time+=0.01;
}
pop();
//if(this.st==0){
//st=1;
this.x=this.x22;
this.time=this.time2;
this.y=this.y22;
this.oldy2=this.oldy22
this.oldx=this.oldx222
//}
this.x22=(noise(this.time+(-this.h/(l*100)))*height/2)//+(width/2)
stroke(0);
push();
noStroke();
fill(0);
textAlign(CENTER,CENTER);
//text("Random Rolle//r Coaster Generator.",width/2,-100)
textSize(30)
// text("Please heart this, It took a long time to make.",width/2,0)
pop();
translate(-(time*400),0)
//ellipse(this.xg,(noise(this.time)*height/2),50)
//noise(this.time-(685/this.l/100))
//y22+=2*keyIsDown(38);
this.y+=this.speed;
// y+=-speed;
//print(xg)
//print(this.xg<-xg)
//x+=2*keyIsDown(38);
this.xg+=this.speed;
if(this.yg>this.x22+40){}
//xg+=-speed;
this.fuel=this.futank;
this.yg-=-this.g
if(this.rd>0){this.rd-=0.006}else{this.rd+=0.006}
if(this.yg>this.x22-4){if(this.xg<-xg&&(this.xg<-(xg+5)||this.xg>-(xg-5))){if(this.speed<0){this.speed+=map(lev,1,5,0.5,1.5)}if(this.fuel>0){
this.speed+=map(lev,1,5,0.4,1);this.fuel-=this.fuus;}
//rd+=(x-oldx222)/50
}else{if(this.xg>-xg&&(this.xg<-(xg+5)||this.xg>-(xg-5))){if(this.speed>0){this.speed-=map(lev,1,5,0.5,1.5)}//if(speed<0){
//rd-=(speed/map(rd,0,3,0.002,0.0001))}else{}//rd+=rd/12}
if(this.fuel>0){this.speed-=map(lev,1,5,0.4,1);this.fuel-=this.fuus;}}else{
}}if(this.speed>0){this.speed-=map(lev,1,5,0.3,0.05)}else{this.speed+=map(lev,1,5,0.3,0.05)}} else{if(xg>this.xg||xg<this.xg){if(this.fuel>0){
this.fuel-=this.fuus/3;}}}
if(this.yg>(this.x22+4)){if(this.l<=4){this.yg+=-abs(this.speed*map(this.l,4,2,1,2))}else{this.yg+=-(abs(this.speed)+1)}
this.g=(this.x-this.oldx222)}if(this.yg>this.x-10){if(this.speed>=0){this.speed-=-((this.x-this.oldx222)/10)}else{
this.speed-=((this.x-this.oldx222)/10)}}
if(this.yg>this.x22){this.yg+=-2;this.g=2;}else{if(this.g>-33377000){this.g+=abs(this.g)/this.gra;}else{print("You broke my game. Cheater")}}
if(this.g>-1&&this.g<0){this.g=1;}
//ellipse(0,yg-15,30)
if(this.gasx<15&&this.gasx>-55&&this.yg>this.gasy&&this.yg<this.gasy+50){this.gash=0;for(var i=0;i<-4;i++){if(this.gst[i]==this.gas){
this.gash=1;}}if(this.gash==0){this.gst.push(this.gas);this.fuel=this.futank;this.sgas=0;}}else{
} this.sgas=1;for(var i2=0;i2<-4;i2++){if(this.gst[i2]==this.gas){this.sgas=0;}}if(this.sgas==1){//ellipse(this.gasx,this.gasy,40)
}
//text(round(xg),0,100)
//text(round(yg),0,200)
//text(round(gasx),100,100)
//text(round(gasy),100,200)
//print(yg)
//ellipse(gasx,gasy,40)
//translate(0,this.place);
scale(0.5,0.5);if(name!=="sketchIframe913531"){noLoop();}
translate(this.xg*2,this.yg*2)
if(yg<0){ translate(0,map(yg,3000,0,-3000,0));//print(place)
}
//translate(-time,0)
this.rd=0;
if(this.yg>this.x-10){
if(this.speed<0.3&&this.speed>-0.3){rotate(-(this.rst+this.rd))}else{rotate(-((-atan((this.x-this.oldx222)/this.speed))+this.rd));
this.rst=(-atan((this.x-this.oldx222)/this.speed))
}}else{rotate(-(this.rst-(this.rst/10)))}
//rotate((x-oldx222)*20);
this.oldy22=this.y;this.oldx222=this.x;
if(this.speed>0&&(this.xg<-(xg+5)||this.xg>-(xg-5))){ image(pol5,-50,-50);if(showHit){push();noFill();stroke(0);rect(-20,-20,70,30);pop();}
}else{ image(pol4,-50,-50);if(showHit){push();stroke(0);noFill();rect(-20,-20,70,30);pop();}
}
textSize(30)
//text(lev,-20,-20);
pol3.resize(120,0)
pol2.resize(120,0)
pol.resize(120,0)
pol4.resize(120,0)
pol5.resize(120,0)
//this.time2+=speed/200
this.time2+=-this.speed/l/100
pop(); textAlign(CENTER);
if(this.fuel<25&&this.fuel>0){push();fill(255,0,0,this.flo);textSize(60);
//text("Fuel Low",width/2,300);
this.flo+=this.fl
if(this.flo>201){this.fl*=-1}
if(this.flo<0){this.fl*=-1}
pop();}
push(0);
//translate(width/2,600)
scale(0.5)
angleMode(DEGREES)
this.rc=map(this.fuel,this.futank/2,this.futank,255,0)
this.gc=map(this.fuel,0,this.futank/2,0,255)
//bc=map(fuel,0,futank,255,0)
//fill(this.rc,this.gc,0)
translate(100,0)
//arc(0,0,200,200,180,-60)
fill(0);
push();
rotate(120)
//line(0,0,-100,0)
rotate(-120)
//line(0,0,-100,0)
pop(0);
rotate(map(this.fuel,0,this.futank,0,120))
//line(0,0,-100,0)
pop()
pop();
if(name!=="sketchIframe913531"){noLoop();}
}
}
function mousePressed(){
if(name!=="sketchIframe913531"){noLoop();}
}
function Bullet(x,y,angle,gunT,speed,v){
this.x=x;
this.y=y;
this.speed=speed
angleMode(DEGREES)
if(gunType==5){
this.angle=angle+random(20,-20);}else{this.angle=angle;}
this.gunT=gunT;
this.v=v;
this.update=function(){
push();
translate(-(time*400),0)
noStroke();
ellipse(this.x,this.y,5,5);
this.x+=this.v*cos(this.angle)
this.x-=this.speed
this.y+=this.v*sin(this.angle)
pop();
}
}
// function draw(){clear();for (var i = 0; i < bubbles.length; i++) {
// bubbles[i].move();
// } //print(bubbles)
// }
/*
function Bubble() {
this.frt=0;
this.st=0;
this.gasy=0;
this.gas=2
this.far=15;
this.fuel=100;
this.fh=0;
this.fl=15;
this.flo=0;
this.x=0;
this.x2=2000;
this.y=-5;
this.y2=0;
this.time=0;
this.gasx=0;
this.oldx2=600;
this.gra=10
this.place=0;
this.oldx=100;
this.oldx222=100;
this.speed=0.1
this.rd=0;
this.gst=[]
this.gash=0;
this.t=0;
this.rst=0;
this.g=2;
this.x22=0;
this.y22=0;
this.oldy=-5;
this.xg=0;
this.yg=0;
this.oldy2=-5;
this.oldy22=-5;
this.time2=0;
this.fuus=0.1
this.l=4;
this.futank=100;
this.move = function() {
var gasim;
function preload(){
gasim=loadImage("gas.png")
}
//l-=0.01
this.fuus=abs(this.xg/100000)
if(this.fuus<0.5){this.fuus=0.5}
//background(4000);
//l+=-0.1
push();
stroke(0.01);
noFill();
rect(5,5,this.futank+4,29)
fill(255,0,0)
noStroke();
rect(7,7,this.fuel,25)
pop();
this.frt++;
this.gasy=(noise(this.gas)*(this.height/2)-50)
this.gasx=this.xg+((this.l*100)*this.gas)
//gas+=0.01
//print(xg)
//if(abs(xg>fh)){fh=xg;far++;}
//if(abs(xg<fh)){fh=xg;far--;}
//print(gasx)
if(this.far<5){this.far=5;}
if(this.gasx<-1000){ if(this.far<5){this.far=5;}
this.gas+=this.far ;
}
if(this.gasx>1000){ if(this.far<5){this.far=5;}
this.gas-=this.far ;
}
//if(xg>gasx+200){gasx+=1000}
//l-=0.001
//scale(33,0.3)
if(this.frt>20){this.frt=0;
//l=map(abs(xg),10000,0,4,5)
}
// if(yg>x-1){print("ghtymuyh")}
push();
translate(width/2,0)
translate(0,200)
this.x=-0;
this.x2=2000;
this.y=-685;
this.y2=-0;
this.time=-this.xg/this.l/100;
this.oldx2=600;
this.oldx=-80000;
this.t=0;
this.oldy=-5;
this.oldy2=-9999999995;
push();
if(this.yg<0){translate(0,this.map(this.yg,3000,0,-3000,0));this.place=0}else{this.place=this.yg;//translate(0,-(yg*2))
}
for(var ii=0;ii<(width/this.l)+20;ii++){
this.x=noise(this.time-(685/this.l/100))*height/2
this.y+=this.l;
stroke(0);
strokeWeight(5);
//point(y,x);
line(this.y,this.x,this.oldy2,this.oldx);this.oldy2=this.y;this.oldx=this.x;
if(this.x>200){
stroke(0,0,255);
//line(y,x,y,200)
}
//line(0,200,1000,200)
stroke(184, 109, 48);
this.t++;
if(this.t>0){this.t=0;
line(this.y,this.x+4,this.y,height+5);}
this.time+=0.01;
}
pop();
if(this.st==0){
//st=1;
this.x=this.x22;
this.time=this.time2;
this.y=this.y22;
this.oldy2=this.oldy22
this.oldx=this.oldx222
}
stroke(0);
push();
noStroke();
fill(0);
textAlign(CENTER,CENTER);
// text("Random Rolle//r Coaster Generator.",width/2,-100)
textSize(30)
// text("Please heart this, It took a long time to make.",width/2,0)
pop();
this.x22=(noise(this.time)*height/2)//+(width/2)
//y22+=2*keyIsDown(38);
this.y+=this.speed;
// y+=-speed;
//x+=2*keyIsDown(38);
this.xg+=this.speed;
if(this.yg>this.x-10){}
//xg+=-speed;
this.yg-=-this.g
if(this.rd>0){this.rd-=0.006}else{this.rd+=0.006}
if(this.yg>this.x-10){if(keyIsDown(38)){if(this.fuel>0){this.speed-=0.5;this.fuel-=this.fuus;}
//rd+=(x-oldx222)/50
}else{if(keyIsDown(40)){//if(speed<0){//rd-=(speed/map(rd,0,3,0.002,0.0001))}else{}//rd+=rd/12}
if(this.fuel>0){this.speed+=0.5;this.fuel-=this.fuus;}}else{
}}if(this.speed>0){this.speed-=0.1}else{this.speed+=0.1}} else{if(keyIsDown(38)||keyIsDown(40)){if(this.fuel>0){this.fuel-=this.fuus/3;}}}
if(this.yg>(this.x+4)){if(this.l<=4){this.yg+=-abs(this.speed*map(this.l,4,2,1,2))}else{this.yg+=-(abs(this.speed)+1)}
this.g=(this.x-this.oldx222)}if(this.yg>this.x-10){if(this.speed>=0){this.speed-=-((this.x-this.oldx222)/10)}else{
this.speed-=((this.x-this.oldx222)/10)}}
if(this.yg>this.x){this.yg+=-2;this.g=2;}else{if(this.g>-33377000){this.g+=abs(this.g)/this.gra;}else{print("You broke my game. Cheater")}}
if(this.g>-1&&this.g<0){this.g=1;}
//ellipse(0,yg-15,30)
if(this.gasx<15&&this.gasx>-55&&this.yg>this.gasy&&this.yg<this.gasy+50){this.gash=0;for(var i=0;i<this.gst.length;i++){
if(this.gst[i]==this.gas){this.gash=1;}}if(this.gash==0){this.gst.push(this.gas);this.fuel=this.futank;this.sgas=0;}}else{
} this.sgas=1;for(var i2=0;i2<this.gst.length;i2++){if(this.gst[i2]==this.gas){this.sgas=0;}}if(this.sgas==1){ellipse(this.gasx,this.gasy,40)}
//text(round(xg),0,100)
//text(round(yg),0,200)
//text(round(gasx),100,100)
//text(round(gasy),100,200)
//print(yg)
//ellipse(gasx,gasy,40)
translate(0,this.place);
scale(0.5,0.5);if(name!=="sketchIframe890103"){noLoop();}
this.rd=0;
if(this.yg>this.x-10){
if(this.speed<0.3&&this.speed>-0.3){rotate(this.rst+this.rd)}else{rotate((-atan((this.x-this.oldx222)/this.speed))+this.rd);
this.rst=(-atan((this.x-this.oldx222)/this.speed))
}}else{rotate(this.rst-(this.rst/10))}
//rotate((x-oldx222)*20);
this.oldy22=this.y;this.oldx222=this.x;
rect(0-20,0-40,40,20);
ellipse(15,-15,20);
ellipse(-15,-15,20);
//time2+=speed/200
this.time2+=-this.speed/this.l/100
pop(); textAlign(CENTER);
if(this.fuel<25&&this.fuel>0){push();fill(255,0,0,this.flo);textSize(60);
text("Fuel Low",width/2,300);
this.flo+=this.fl
if(this.flo>201){this.fl*=-1}
if(this.flo<0){this.fl*=-1}
pop();}
push(0);
translate(width/2,600)
scale(0.5)
angleMode(DEGREES)
this.rc=map(this.fuel,this.futank/2,this.futank,255,0)
this.gc=map(this.fuel,0,this.futank/2,0,255)
//bc=map(fuel,0,futank,255,0)
fill(this.rc,this.gc,0)
arc(0,0,200,200,180,-60)
fill(0);
push();
rotate(120)
line(0,0,-100,0)
rotate(-120)
line(0,0,-100,0)
pop(0);
rotate(map(this.fuel,0,this.futank,0,120))
line(0,0,-100,0)
pop()
}
}
*/