xxxxxxxxxx
108
function setup() {
createCanvas(400, 400);
textFont('Courier New');
}
const T = '.o8@';
let a = T;
function draw() {
background("#96D3F1");
push();
scale( 1 + sin(frameCount/5)/20 ,
1 + sin(frameCount/5 +1)/200);
textSize(16);
fill("green");
stroke("white");
strokeWeight(5);
text(' +----+',2,220);
text(` |${a}|`,2,220+10*1);
text(' +----+',2,220+10*2);
text(' |####|',2,220+10*3);
text(' |####|',2,220+10*4);
text('~~|####|',2,220+10*5);
text(' +----+',2,220+10*6);
if (frameCount%30==0)
a = a.substring(1) + T[~~(random(4))];
pop();
textSize(24);
man( ~~(noise(frameCount/10)*5)+1 );
push();
textSize(24);
translate(270,200);
rotate(6.3 + sin(frameCount/60)/8);
scale(.35);
man( ~~(noise(frameCount/20)*5)+1 );
pop();
}
function man(state){
fill("darkblue");
noStroke();
if (state==1){
text(' W |/_ W',120,100+26*-1);
text(' \\ (Oo) /',120,100+26*0);
text(' \\_~ _/',120,100+26*1);
text(' |\\/|',120,100+26*2);
text(' | |',120,100+26*3);
text(' +==+ ',120,100+26*4);
text(' / | ',120,100+26*5);
text(' / | ',120,100+26*6);
text(' \\ | ',120,100+26*7);
text(' \\ | ',120,100+26*8);
text(' _# #_ ',120,100+26*9);
return;
}
if (state==2){
text(' W \\|/ ',120,100+26*-1);
text(' \\ (OO) ',120,100+26*0);
text(' \\_- _____E',120,100+26*1);
text(' |\\/| ',120,100+26*2);
text(' | | ',120,100+26*3);
text(' +==+ ',120,100+26*4);
text(' || ',120,100+26*5);
text(' || ',120,100+26*6);
text(' || ',120,100+26*7);
text(' || ',120,100+26*8);
text(' _##_ ',120,100+26*9);
return;
}
if (state==3){
text(' W _\\| ',120,100+26*-1);
text(' \\ (oo) ',120,100+26*0);
text(' \\_-__ ',120,100+26*1);
text(' |\\/|\\',120,100+26*2);
text(' | | \\',120,100+26*3);
text(' +==+ M',120,100+26*4);
text(' |\\ ',120,100+26*5);
text(' | \\ ',120,100+26*6);
text(' | / ',120,100+26*7);
text(' | # ',120,100+26*8);
text(' _# \\',120,100+26*9);
return;
}
if (state==4){
text(' _\\| ',120,100+26*-1);
text(' (oO) ',120,100+26*0);
text('3_____o _____E',120,100+26*1);
text(' |\\/|',120,100+26*2);
text(' | |',120,100+26*3);
text(' +==+ ',120,100+26*4);
text(' /\\ ',120,100+26*5);
text(' / \\ ',120,100+26*6);
text(' / / ',120,100+26*7);
text(' / # ',120,100+26*8);
text(' _# \\',120,100+26*9);
return;
}
}