xxxxxxxxxx
101
function setup() {
createCanvas(600, 600);
a = -122.5;
sp = 10;
b = 122.5;
spb = 10;
}
function draw(){
background(0);
//backdrop
push()
translate(width-300, height-300);
for(let x=-300;x<width;x+=20){
for(let y=-300;y<height;y+=20){
fill(y,y,y);
stroke(255);
square(x,y,20);
}
}
pop()
//text & heart
translate(width-300, height-300);
//text
if(abs(mouseX-300)<100 && abs(mouseY-300)<100){
push()
for(let x=-300;x<width;x+=5){
for(let y=-300;y<height;y+=5){
if(x<0||y<0){
noStroke();
fill(x^y,0,0);
rect(x,y,5,5);
}
else if(x>0 ||y>0){
noStroke();
fill(x^y,0,0);
rect(x,y,5,5);}
}
}
textFont("Helvetica");
textSize(30);
fill(255);
textAlign(CENTER);
text("Be a heroine to make the world better", -200,-70,400,400);
text("BE A HEROIN TO GET YOU ADDICTED",-200,30,400,400)
frameRate(500);
strokeWeight(3);
stroke(255,0,0);
line(200,-10,-200,-65);
line(200,-65,-200,-10);
pop()
//heart
push()
translate(width-830,height-500);
noStroke();
fill(255,0,random(132,193));
circle(-9,0,20);
circle(9,0,20);
triangle(0,30,-18.7,3,18.7,3);
pop()
push()
translate(230,-120)
noStroke();
fill(255,0,random(132,193));
circle(-9,0,20);
circle(9,0,20);
triangle(0,30,-18.7,3,18.7,3);
pop()
//moving lines
push()
frameRate(millis()/50);
a = a-sp;
if(a<-300){
a = -122.5};
strokeWeight(1)
stroke(255,0,0);
line(-300,a,width,a);
line(-300,a+20,width,a+20);
line(-300,a+40,width,a+40)
pop()
push()
frameRate(millis()/50);
b = b+spb;
if(b>300){
b = 122.5};
strokeWeight(1);
stroke(255,0,0);
line(-300,b,width,b);
line(-300,b+20,width,b+20);
line(-300,b+40,width,b+40);
pop()}
}