xxxxxxxxxx
let count;
let emojis = [];
function setup() {
createCanvas(windowWidth, windowHeight);
background(0);
textAlign(CENTER, CENTER);
emojis = emojis1;
drawCrowd();
}
function drawCrowd() {
background(0);
count = 0;
let y = 30;
let ys = 15;
while (y <= height) {
let x = 0;
while (x <= width +ys) {
let a = map(x, 0, width+ys,-HALF_PI,HALF_PI);
push();
translate(x,y);//-ys*cos(a)
textSize(ys*random(0.9,1.1));
rotate(random(-PI/12, PI/12));
//絵文字がランダムに変わる様にしている
text(emojis[floor(random(emojis.length))], 0, 0);
x+=ys;
pop();
count++;
}
ys *=1.25;
y += ys*0.65;
}
}
//マウスをクリックするたびに画面の中の絵文字が変わる様にしている
function mouseClicked() {
if(emojis==emojis1) emojis = emojis2;
else emojis=emojis1;
drawCrowd();
}