xxxxxxxxxx
50
let gfx;
let lineCount;
let fileNameCounter = 0;
var QUICKLY_TURN_IT_OFF;
function setup() {
createCanvas(128, 128);
gfx = createGraphics(128, 128);
gfx.clear();
lineCount = floor(random(5, 20));
QUICKLY_TURN_IT_OFF = createCheckbox("QUICK. TURN IT OFF!!!!!!!!!⚠").checked(0)
}
function draw() {
image(gfx, 0, 0);
for (let i = 0; i < lineCount; i++) {
gfx.stroke(random(255), random(255), random(255), random(255)); // Random color
gfx.noFill();
gfx.bezier(random(width), random(height), random(width), random(height), random(width), random(height), random(width), random(height));
}
if (frameCount % lineCount == 0){
gfx.clear()
background(255,255,255,66)
}
if (QUICKLY_TURN_IT_OFF.checked()){
if (frameCount % 2 == 0){
saveCanvas(gfx, 'BezierLines_' + fileNameCounter, 'png'); // Save the canvas with unique name
fileNameCounter++;
gfx.clear(); // Clear the buffer
lineCount = floor(random(5, 20));
}
}
}
function mouseClicked() {
lineCount = floor(random(5, 20));
saveCanvas(gfx, 'BezierLines_' + fileNameCounter, 'png'); // Save the canvas with unique name
fileNameCounter++;
gfx.clear(); // Clear the buffer
lineCount = floor(random(5, 20));
}