xxxxxxxxxx
48
/*
system variables example
2/28/2024
*/
// global scope
var x = 0;
function setup() {
// createCanvas(400, 400);
createCanvas(windowWidth, 400);
// frameRate(60);
}
function draw() {
background(220);
// hard coded
ellipse(200, 200, 200);
textSize(20);
text(frameCount, 20, 20);
// variables
// ellipse(mouseX, mouseY, 200);
ellipse(x, 200, 200);
x = x + 1;
// width and height variables
var centerX = width / 2;
var centerY = height / 2;
ellipse(centerX, centerY, width, height);
// rect(0, 0, width, height);
// triangle(0, 0, width, 0, 0, height);
// dynamic variables
ellipse(mouseX, mouseY, 20);
line(pmouseX, pmouseY, mouseX, mouseY);
fill(mouseX, mouseY, 0);
ellipse(200, 200, mouseX + 100);
}