xxxxxxxxxx
228
//author:kiyomi
let cnv
let R,G,B,A;
let xPos =0, yPos = 0
let velocity = 1
rectSize = 200
function setup() {
cnv = createCanvas(700,900);
cnv.position((windowWidth - 700) / 2, (windowHeight - 900) / 2)
angleMode(DEGREES)
}
function draw() {
background('white')
stroke('black');
noFill();
rectMode(CENTER);
rect( 350, 450, 650,850 );
cursor('help')
fill('black')
///// bouncing ball
push();
translate(250, 400)
let a
a = map( yPos, -rectSize / 2, rectSize /2, 0, 255 )
fill(0,0,0,a);
noStroke();
yPos = yPos + velocity;
square(xPos, yPos, 10);
if (yPos > rectSize / 2 || yPos < -rectSize / 2) {
velocity = -velocity;
}
pop();
////
push()
translate(300, 400);
noStroke()
textFont('Times');
textSize(20);
textAlign(LEFT, TOP)
text("why won't you do it for me?", 0, 20)
pop()
push()
translate(22, 855);
rotate(-90)
noStroke()
textFont('Times');
textSize(15);
textAlign(LEFT, TOP)
text("c e l l o p h a n e : f k a t w i g s", 0, 20)
pop()
if (keyIsPressed == true){
background(0)
stroke('white');
noFill();
rectMode(CENTER);
rect( 350, 450, 650,850 );
circle(600,200, 500)
circle(200,600, 300)
circle(205,600, 300)
for (var b = 0; b<=height; b= b+10 ){
push()
translate(500,300)
stroke(255)
rect(100,100,200,b)
pop()
}
push()
translate(100, 650)
stroke(255)
rect(100,100,1,100)
pop()
push()
translate(80, 625)
stroke(255)
rect(100,100,1,150)
pop()
fill('white')
text("WHY WON'T YOU DO IT FOR ME?",mouseX, mouseY)
line(mouseX, mouseY, pmouseX, pmouseY)
let x1 = map(mouseX, 0, width, 25, 75);
ellipse(x1, 25, 25, 25);
let x2 = map(mouseX, 0, width, 0, 100, true);
ellipse(x2, 75, 25, 25);
//DIDNT I DO IT FOR YOU?
push()
translate(100, 90);
noStroke()
textFont('Times');
textSize(80);
textAlign(LEFT, TOP)
text("didn't i do it for you", 0, 20)
pop()
// push()
// translate(450, 150);
// noStroke()
// textFont('Times');
// textSize(80);
// textAlign(LEFT, TOP)
// text("for you?", 0, 20)
// pop()
//WHY WONT YOU DO IT FOR ME?
push()
translate(170, 300);
noStroke()
textFont('Times');
textSize(20);
textAlign(LEFT, TOP)
text("why won't you do it for me?", 0, 20)
pop()
push()
translate(175, 305);
noStroke()
textFont('Times');
textSize(20);
textAlign(LEFT, TOP)
text("why won't you do it for me?", 0, 20)
pop()
//TOP RIGHT
push()
translate(200, 220);
noStroke()
textFont('Times');
textSize(20);
textAlign(LEFT, TOP)
text("why won't you do it for me?", 0, 20)
pop()
//WHEN ALL I DO IS FOR YOU?
push()
translate(620,600);
noStroke()
textFont('Times');
textSize(40);
textAlign(RIGHT, BOTTOM)
text("when all i do is for you?", 0, 20)
pop()
if ((mouseY>590) && (mouseX>190)){
for (var y= 0; y<=height; y += 20) {
push()
translate(620,643);
noStroke()
textFont('Times');
textSize(40);
textAlign(RIGHT, BOTTOM)
text("when all i do is for you?", 0, y)
pop()
}
}else if((mouseY>200) && (mouseX>190)){
push()
translate(200,200);
noStroke()
textFont('Times');
textSize(20);
textAlign(RIGHT, BOTTOM)
text("why won't you do it for me?", 100, 100)
pop()
push()
translate(400,120);
noStroke()
textFont('Times');
textSize(20);
textAlign(RIGHT, BOTTOM)
text("why won't you do it for me?", 100, 100)
pop()
push()
translate(430,125);
noStroke()
textFont('Times');
textSize(20);
textAlign(RIGHT, BOTTOM)
text("why won't you do it for me?", 100, 100)
pop()
}
}
}