xxxxxxxxxx
float theta = 0;
float speed = -.000001;
float squareCount = 0;
boolean isPlaying = true;
void setup() {
fullScreen();
background(0);
noFill();
stroke(70, 173, 212);
rectMode(CENTER);
}
void draw() {
background(0);
translate(width/2, height/2);
recursiveSquares(600, 600);
}
void recursiveSquares(float length_, float height_) {
rotate(theta);
if(isPlaying) {
theta += speed;
}
rect(0, 0, length_, height_);
if (length_ > 0 & height_ > 0 && squareCount < 1000) {
squareCount++;
recursiveSquares(length_ + 5, height_ + 5);
}
squareCount = 0;
}
void keyPressed() {
isPlaying = !isPlaying;
}