xxxxxxxxxx
85
function setup() {
createCanvas(windowWidth, windowHeight);
background(0);
frameRate(60);
}
let words = ['kidnap','immoral','scum','某些人','不配','垃圾','humanity','is dead','fuck you','bitch','kidnap','kidnap','kidnap','噁心','formalism','control','control','control','你姓趙?','糞坑','泛娛樂化','state apparatus',"u r nothing",'綁架','綁架','割席','崇高'];
class Text{
constructor(startedtime,content){
this.x = random(width/10,width*9/10);
this.y = random(height/10,height*9/10);
this.startedTime = startedtime;
this.lifeCounter = 0;
this.size = random(width/40,width/35);
this.content = content;
this.noisep = 0;
}
display(){
if (this.lifeCounter<3000){
fill(noise(this.noisep)*155+100);
noStroke();
textAlign(CENTER);
textSize(this.size);
text(this.content,this.x,this.y);
this.x+=random(-width/40,width/40);
this.y+=random(-height/40,height/40);
this.noisep += 0.01;
this.lifeCounter ++;
} else {
return;
}
}
shouldBeKilled(){
if (this.lifeCounter>=3000){
return true;
} else {
return false;
}
}
}
let t = 0;
let arrayOfText = [];
function draw() {
background(0,150);
if (millis()-t>5000 || t ==0){
let num = floor(random(2,5));
for (let i=0;i<num;i++){
let tem = new Text(0,words[floor(random(words.length))]);
arrayOfText.push(tem);
if (arrayOfText.length > 12){
arrayOfText.shift();
}
}
t= millis();
}
for (let i = 0 ;i<arrayOfText.length;i++){
arrayOfText[i].display();
let x1,y1,x2,y2;
if (i==0){
x1 = arrayOfText[arrayOfText.length-1].x;
y1 = arrayOfText[arrayOfText.length-1].y;
x2 = arrayOfText[i].x;
y2 = arrayOfText[1].y;
} else {
x1 = arrayOfText[i-1].x;
y1 = arrayOfText[i-1].y;
x2 = arrayOfText[i].x;
y2 = arrayOfText[1].y;
}
push();
stroke(255,150);
//line(x1,y1,x2,y2);
pop();
}
if (t > 500000){
t = 0;
}
}