This commit is contained in:
Jürg Hallenbarter
2026-04-01 11:28:05 +00:00
parent 10c9cad0a6
commit 3f9de9c266
13 changed files with 336 additions and 158 deletions

29
sketches/Cubes.js Normal file
View File

@@ -0,0 +1,29 @@
var size = 0
var randomX = 0
var randomY = 0
var mouseIndex = 0
function setup() {
createCanvas(500, 500);
background(255,255,255)
noFill();
for (i = 0; i < 30; i++){
size = random(0, 15)*i;
randomX = random(-width/10, width/10);
randomY = random(-height/10, height/10);
square(width/2 +randomX - size/2, height/2 +randomY- size/2, size);
}
}
function draw() {
}
function mousePressed(){
mouseIndex++
size = random(0, 15)*i;
randomX = random(-width/10, width/10);
randomY = random(-height/10, height/10);
square(width/2 +randomX - size/2, height/2 +randomY- size/2, size);
}