xxxxxxxxxx
371
let back;
let border;
let scream;
let button;
let clapclap;
let can;
let we;
let please;
let just;
let go;
let home;
let now;
let colours;
let s;
let b;
let count = 0;
let nail;
let words;
let displaytext;
let lastChar;
let temptext;
let tp;
let lft;
let rgt;
let btm;
function preload() {
back = loadImage('back-04.png');
border = loadFont('Italiana-Regular.ttf');
scream = loadFont('Jaan.ttf');
button = loadFont('Button.ttf');
clapclap = loadImage('Asset 5.png');
}
function setup() {
createCanvas(1000, 1000);
colorMode(HSB, 360, 100, 100, 100);
textAlign(CENTER, CENTER);
angleMode(DEGREES)
frameRate(3)
image(back, 0, 0, 1000, 1000);
colours = [50, 0, 290, 260, 240]
s = 70;
b = 100;
nail1 = new bolts(139, 139)
nail2 = new bolts(860, 139)
nail3 = new bolts(860, 860)
side = new disco(55, 55)
side2 = new disco(width - 55, 55)
side3 = new disco(55, height - 55)
side4 = new disco(width - 55, height - 55)
words = str("THANKS NO THANKS 2020 ");
displaytext = words;
tp = new thanks(500, 65, 0);
lft = new thanks(500, 935, 180);
rgt = new thanks(935, 500, 90);
btm = new thanks(65, 502, 270);
}
function draw() {
nail1.show()
nail2.show()
nail3.show()
side.be()
side2.be()
side3.be()
side4.be()
lastChar = displaytext[displaytext.length - 1];
temptext = '';
for (let i = 0; i < displaytext.length - 1; i++) {
temptext = temptext + displaytext[i]
}
displaytext = lastChar + temptext;
tp.dis()
lft.dis()
rgt.dis()
btm.dis()
//buttons
noStroke()
fill(348, 12, 14)
rect(125, 777, 102, 102)
rect(235, 777, 102, 102)
textSize(14)
textFont(button);
//#1
fill(colours[0], s, b)
text("fine i guess", 173.5, 863)
beginShape()
vertex(153, 852)
vertex(153, 818)
vertex(146, 818)
vertex(175.5, 788.5)
vertex(206, 818)
vertex(198, 818)
vertex(198, 852)
vertex(181, 852)
vertex(181, 837)
vertex(171, 837)
vertex(171, 852)
endShape(CLOSE)
//#2
fill(colours[1], s, b)
text("no", 287, 863)
noFill()
stroke(colours[1], s, b)
strokeWeight(6.7)
line(311, 800, 259, 852)
line(259, 800, 311, 852)
}
class bolts {
constructor(nx, ny) {
this.x = nx;
this.y = ny;
this.r = 28;
}
show() {
push()
let targetAngle = atan2(mouseY - this.y, mouseX - this.x);
translate(this.x, this.y)
rotate(targetAngle)
stroke(240, 0, 92)
strokeWeight(2)
fill(colours[1], s, b)
circle(0, 0, this.r)
line(0 - (this.r / 2), 0, 0 + (this.r / 2), 0)
pop()
}
}
class disco {
constructor(xx, yy) {
this.x = xx;
this.y = yy;
this.c = 150;
this.sb = 0;
}
be() {
push()
translate(this.x, this.y);
noStroke()
// this.c = map(mouseX, 0, width, 0, 360)
// this.sb = map(mouseY, 0, height, 70,100)
fill(348, 12, 14)
ellipse(0, 0, 15, 15)
pop()
}
}
class thanks {
constructor(tx, ty, tr) {
this.x = tx;
this.y = ty;
this.r = tr
}
dis() {
push()
translate(this.x, this.y)
rotate(this.r)
noStroke()
fill(240, 0, 92)
rect(-405, -20.5, 810, 60)
textFont(border);
fill(348, 12, 14)
textSize(70)
text(displaytext, 0, 0);
pop()
}
}
class goHome {
constructor(tyx, tyy, tysc) {
this.x = tyx;
this.y = tyy;
this.script = tysc;
}
show() {
textSize(145)
textFont(scream);
noStroke()
fill(210, 0, 40, 25)
text(this.script, this.x + 20, this.y + 20);
stroke(240, 0, 100)
strokeWeight(2)
for (let i = 0; i < 26; i = i + 5) {
if (i < 5) {
fill(colours[0], s, b)
} else if (i >= 5 && i < 10) {
fill(colours[1], s, b)
} else if (i >= 10 && i < 15) {
fill(colours[2], s, b)
} else if (i >= 15 && i < 20) {
fill(colours[3], s, b)
} else if (i >= 20 && i < 25) {
fill(colours[4], s, b)
} else if (i == 25) {
fill(colours[4], 0, b)
}
text(this.script, this.x - i, this.y - i);
}
}
}
function mouseClicked() {
count++;
can = new goHome(mouseX, mouseY, "can")
we = new goHome(mouseX, mouseY, "we")
please = new goHome(mouseX, mouseY, "please")
just = new goHome(mouseX, mouseY, "just")
go = new goHome(mouseX, mouseY, "go")
home = new goHome(mouseX, mouseY, "home")
now = new goHome(mouseX, mouseY, "now")
tired = new goHome(random(250, width - 250), random(100, height - 100), "v tired")
please2 = new goHome(random(250, width - 250), random(100, height - 100), "please")
if (count == 1) {
can.show();
}
if (count == 2) {
image(clapclap, mouseX - 100, mouseY - 100, 200, 200);
}
if (count == 3) {
we.show();
}
if (count == 4) {
image(clapclap, mouseX - 100, mouseY - 100, 200, 200);
}
if (count == 5) {
please.show();
}
if (count == 6) {
image(clapclap, mouseX - 100, mouseY - 100, 200, 200);
}
if (count == 7) {
just.show();
}
if (count == 8) {
image(clapclap, mouseX - 100, mouseY - 100, 200, 200);
}
if (count == 9) {
go.show();
}
if (count == 10) {
image(clapclap, mouseX - 100, mouseY - 100, 200, 200);
}
if (count == 11) {
home.show();
}
if (count == 12) {
image(clapclap, mouseX - 100, mouseY - 100, 200, 200);
}
if (count == 13) {
now.show();
}
if (count == 14) {
image(clapclap, mouseX - 100, mouseY - 100, 200, 200);
}
if (count > 14) {
textSize(30)
textFont(scream);
noStroke()
fill(210, 0, 40, 50)
text("v tired", mouseX, mouseY);
}
if (mouseY > 777 && mouseY < 777 + 102) {
if (mouseX > 125 && mouseX < 125 + 102) {
image(back, 0, 0, 1000, 1000);
draw()
count = 0;
}
if (mouseX > 235 && mouseX < 235 + 102) {
image(back, 0, 0, 1000, 1000);
draw()
tired.show()
please2.show()
count = 0;
}
}
}