//shoots red green & blue lasers from bottom of fram to top
//or surface-to-air Star Wars anti-Communist anti-satellite
//laser defense sys emulator in 2d
//inspired by TRW Research (active per local eyewitness 10/17/16
//IP Tapper@ssstudios LA,CA
//global vars
int bluelxpos = 38;
int bluelypos = 398;
int laserwidth = 6;
int laserheight = 188;
int redlxpos = 200;
int redlypos = 366;
int gnlxpos = 325;
int gnlypos = 333;
int framecount = 0; //for testing & frame-tracking
void setup(){
size(400,400);
background(0);//k
frameRate(120);//default fr x2
framecount++;
drawlasers();
}
void drawlasers(){
//blue
fill(38, 38, 200);
rect(bluelxpos, bluelypos, laserwidth, laserheight);
//red
fill(255,0,0);
rect(redlxpos, redlypos, laserwidth, laserheight);
//gn
fill(0,255,0);
rect(gnlxpos, gnlypos, laserwidth, laserheight);
laserheight--;
}//end drawlasers
void draw(){
//shoot lasers up
//blue
fill(38, 38, 200);
bluelypos--; //delta y blue laser
rect(bluelxpos, bluelypos, laserwidth, laserheight);
if(bluelypos+laserheight==0){//refire
bluelxpos = (int)random(1,399);
bluelypos = 398;
}//end if
//rd
fill(255,0,0);
redlypos--; //delta y red laser
rect(redlxpos, redlypos, laserwidth, laserheight);
if(redlypos+laserheight==0){//refire
redlxpos = (int)random(1,399);
redlypos = 366;
}//end if
//gn
fill(0,255,0);
gnlypos--; //delta y gn laser
rect(gnlxpos, gnlypos, laserwidth, laserheight);
if(gnlypos+laserheight==0){//refire
gnlxpos = (int)random(1,399);
gnlypos = 333;
}//end if
framecount++;
}//end draw


Chris Welke

"walk into the club like what up? I got a big cock!" -Macklemore

Leave a Reply

Your email address will not be published. Required fields are marked *

Time limit is exhausted. Please reload CAPTCHA.