/* built with Studio Sketchpad:
* https://sketchpad.cc
*
* observe the evolution of this sketch:
* https://studio.sketchpad.cc/sp/pad/view/ro.aYBFUSSSFuG/rev.6576
*
* authors:
* Lee Gerny
* license (unless otherwise specified):
* creative commons attribution-share alike 3.0 license.
* https://creativecommons.org/licenses/by-sa/3.0/
*/
void setup(){
size(500,500);
}
int delay = -100;
float a = 125;
float b = 434;
float timer = 125;
int c = 195;
int d = 230;
int f = 370;
int e = 330;
float l = 125;
int z = 452;
int y =300;
int ax = 250;
int ay = 320;
float tankx = -300;
float tanky = -437;
float tanky1 = 433.5;
int doorx = 305;
int doory = 396;
float ballx = 750;
int q = 90;
int p = 130;
int o = 420;
int u = 460;
int colorball = 255;
float xoff = 0;
void draw(){
background(255);
strokeWeight(1);
float n = noise(xoff) * width+frameCount;
tanky1 = tanky1 + .002;
ballx = ballx - .9;
a = a + .5;
b = b - .5;
l = l + .5;
timer = timer + .5;
rect(100,440,15,10);
ellipse(103,450,5,5);
ellipse(112,450,5,5);
strokeWeight(2);
line(116.49,440,125,435);
point(a,b);
strokeWeight(3);
if(a>200){
point(random(c,d),random(e,f));
point(random(c,d),random(e,f));
point(random(c,d),random(e,f));
point(random(c,d),random(e,f));
point(random(c,d),random(e,f));
point(random(c,d),random(e,f));
point(random(c,d),random(e,f));
point(random(c,d),random(e,f));
point(random(c,d),random(e,f));
point(random(c,d),random(e,f));
point(random(c,d),random(e,f));
point(random(c,d),random(e,f));
}
if(a>210){
a = 600;
}
if(l>240){
c = -10; d = -10;
}
strokeWeight(1);
line(205,z,205,y);
line(0,452,500,452);
if(timer>200){
z = -100;
y = -100;
line(205,452,205,370);
line(205,370,210,360);
line(210,360,215,380);
line(215,380,210,390);
line(210,390,212,395);
line(210,360,213,350);
line(213,350,217,355);
line(217,355,225,350);
line(213,350,214,340);
line(214,340,210,335);
line(210,335,217,330);
line(210,335,205,330);
line(205,330,205,300);
}
//left tower
line(240,300,240,452);
//left tower cap
line(190,300,220,270);
line(220,270,255,300);
line(190,300,255,300);
//wall
//bottom line
line(240,335,400,335);
//top line
line(240,330,400,330);
//turrets
rect(ax,ay,6,10);
rect(ax+15,ay,6,10);
rect(ax+30,ay,6,10);
rect(ax+45,ay,6,10);
rect(ax+60,ay,6,10);
rect(ax+75,ay,6,10);
rect(ax+90,ay,6,10);
rect(ax+105,ay,6,10);
rect(ax+120,ay,6,10);
rect(ax+135,ay,6,10);
//right tower
line(400,452,400,300);
line(435,452,435,300);
//right tower cap
line(450,300,385,300);
line(385,300,417.5,275);
line(417.5,275,450,300);
//window
ellipse(320,365,30,30);
line(320,350,320,380);
line(305,365,335,365);
//doorway
strokeWeight(.3);
arc(320,405,35,35,10,12);
strokeWeight(1);
line(305.3,395,305.3,452);
line(334,394,334,452);
rect(305,396,29,56);
line(310,396,310,452);
line(315,396,315,452);
line(320,396,320,452);
line(325,396,325,452);
line(330,396,330,452);
if(timer>300){
fill(0);
rect(doorx,doory,29,56);
}
fill(255);
//tank
if(timer>310){
tankx = 300;
tanky = 435;
}
if(timer>510){
tankx = 1000;
}
if((timer>490)&&(timer<520)){
fill(0);
rect(305,395,29,56);
}
fill(255);
rect(tankx,tanky,30,15);
ellipse(tankx+5,tanky+15,5,5);
ellipse(tankx+25,tanky+15,5,5);
strokeWeight(2);
line(tankx,tanky,tankx-10,tanky);
stroke(colorball);
point(ballx,tanky1);
strokeWeight(1);
stroke(0);
if(timer>380){
colorball = 0;
}
if(timer>475){
noStroke();
fill(255);
ellipse(110,440,40,40);
}
stroke(1);
if(timer>475){
strokeWeight(3);
point(random(q,p),random(o,u));
point(random(q,p),random(o,u));
point(random(q,p),random(o,u));
point(random(q,p),random(o,u));
point(random(q,p),random(o,u));
point(random(q,p),random(o,u));
point(random(q,p),random(o,u));
point(random(q,p),random(o,u));
}
strokeWeight(1);
if(tanky1>480){
tanky1 = -200;
}
if(timer>320){
doorx = -500;
}
if(timer>475){
colorball = 255;
}
if(timer>530){
q = -10;
p = -10;
}
float flagx = noise(frameCount*0.02, 0.2);
triangle(320,250,320,270,flagx*5+350,flagx*20+255);
line(319,250,319,330);
if(timer>475){
arc(107,451,37,23,0,PI);
}
}