xxxxxxxxxx
88
//It means both building and destroying machines, identities, categories, relationships, space stories. Though both are bound in the spiral dance, I would rather be a cyborg than a goddess.
let eyes=['image/eye1.gif','image/eye4.gif','image/eye5.gif','image/eye7.gif','image/eye8.gif','image/nose1.gif','image/nose4.gif','image/nose5.gif','image/nose8.gif','image/nose10.gif','image/ear1.gif','image/ear2.gif','image/ear5.gif','image/ear6.gif','image/mouth1.gif','image/mouth2.gif','image/mouth9.gif','image/mouth12.gif'];
let neweyes = [];
let eye4;
let count=0;
function setup() {
createCanvas(600, 600);
for(var i=0;i<eyes.length;i++){
eye=new Eye(i);
neweyes.push(eye);
}
}
function draw() {
background(0);
for (var i in neweyes){
neweyes[i].start();
}
//eye4.start();
count++;
}
class Eye{
constructor(i,y){
this.path=i
this.x=random(-50,520);
this.y=random(-50,520);
this.width = random(100,200);
this.height = width;
this.self=loadImage(eyes[i]);
this.show=5*pow((i%5),2);
this.exist=false;
this.inter=floor(random(20,40));
this.in=false;
this.tran=0;
}
start(){
if(count%this.show==this.show-1){
this.exist=true;
}
if (this.exist){
if((count%(this.inter*3)==3*this.inter-1)){
this.in=true;
}
if(count%(this.inter*7)==7*this.inter-1){
this.in=false;
}
if(this.in){
if(this.tran>=255){
this.tran=255;
}
tint([255,255,255, this.tran+=10]);
}
if(!this.in){
if(this.tran<=0){
this.tran=0;
this.flush();
}
tint([255,255,255, this.tran-=10]);
}
image(this.self,this.x,this.y,this.width,this.width);
filter(GRAY);
}
}
switchE(){
if(this.in==true){
this.in=false;
}else{
this.in=true;
}
}
flush(){
this.x=random(-50,520);
this.y=random(-50,520);
this.width=random(100,200);
}
}