xxxxxxxxxx
31
let p;
let pixel = [];
let n = 0;
let r = 20;
let colpall = ["#FF0033", "#00FF80", "#FFA600"];
function setup() {
// createCanvas(1754, 2480);
createCanvas(800, 800);
rectMode(CENTER);
for (let i = 0; i < width + 1; i += r) {
for (let j = 0; j < height + 1; j += (r*2)) {
p = new Pixel(i, j, random(r, r + 2), colpall[floor(random(0, 3))]);
pixel.push(p);
}
}
background(0);
for (let px of pixel) {
px.display();
}
}
function keyPressed() {
if (key === 's') {
saveFrames('frame', 'png', 1, 2);
}
}