xxxxxxxxxx
64
let tileCount;
let x;
function setup() {
createCanvas(windowWidth, windowHeight);
colorMode(HSB, 360, 100, 100, 100);
frameRate(20);
background(0);
x = 1;
//rectMode(CENTER);
}
function draw() {
background(0, 1);
//background(0, 100, random(100), 5);
noStroke();
//fill(random(250, 300), random(100), random(100));
fill(0);
rectMode(CENTER);
rect(width/2, random(height), width, random(50))
tileCount = width*random(0.001, 0.03);
fill(0);
rect(random(width), random(height), random(100));
if (frameCount%30==0){
grid();
}
x+=1;
}
function grid(){
for (let gridY = 0; gridY < tileCount; gridY++) {
for (let gridX = 0; gridX < tileCount; gridX++) {
let posX = (width / tileCount) * gridX;
let posY = (height / tileCount) * gridY;
noStroke();
rectMode(CORNER);
//fill(0);
//rect(posX, posY, width/tileCount, height/tileCount);
var toggle = floor(random(2));
if (toggle == 1){
fill(0, 0);
rect(posX, posY, width/tileCount, height/tileCount);
// } if (toggle == 3){
// fill(random(360), 100, random(10));
} else {
fill(100, random(100), 100) ;
rect(posX, posY, width/tileCount, height/tileCount);
}
}
}
}
function mousePressed() {
if (mouseX < width){
let fs = fullscreen();
fullscreen(!fs);
}
}