xxxxxxxxxx
35
const POINT = 0;
const RECTANGLE = 1;
const ELLIPSE = 2;
const CIRCLE = 3;
const count = 100;
let sx;
const sy = 50;
let w;
let h;
const SHAPES = [POINT, RECTANGLE, ELLIPSE, CIRCLE]
let p = [];
function setup() {
createCanvas(400, 400);
for (let j = 0; j < count; j++) {
for (let i = 0; i < count; i++) {
sx = i * width/count
w = width/count;
h = height/count;
p.push(new Point(sx+w/2, sy-j*w, w, h, ELLIPSE, SHAPES));
}
}
}
function draw() {
background(220);
p.forEach(pont => {
pont.show();
pont.fall();
})
}