xxxxxxxxxx
51
var quad1 = {
x1: 10,
y1: 20,
x2: 30,
y2: 50,
x3: 60,
y3: 70,
x4: 10,
y4: 10,
}
function setup() {
createCanvas(windowWidth, windowHeight);
background(20);
frameRate(10);
noCursor();
}
function draw() {
noFill();
stroke(220, 60);
strokeWeight(0.66);
quad(mouseX, mouseY, quad1.x2, quad1.y2, quad1.x3, quad1.y3, quad1.x4, quad1.y4);
quad1.x1 = random(0, width);
quad1.y1 = random(0, height);
quad1.x2 = random(0, width);
quad1.y2 = random(0, height);
quad1.x3 = random(0, width);
quad1.y3 = random(0, height);
quad1.x4 = random(0, width);
quad1.y4 = random(0, height);
}
function windowResized() {
resizeCanvas(windowWidth, windowHeight);
background(20);
}
function keyTyped() {
if (key === "s") {
saveFrames("quad circle rando draw", "png", 1, 1);
}
}
function mouseReleased() {
background(20);
}