Skip to content

Instantly share code, notes, and snippets.

@KrabCode
Created January 15, 2018 07:24
Show Gist options
  • Select an option

  • Save KrabCode/1203f49db4927de1ceddbd983811a66f to your computer and use it in GitHub Desktop.

Select an option

Save KrabCode/1203f49db4927de1ceddbd983811a66f to your computer and use it in GitHub Desktop.
squares recursively from zero++ limited by max size
public void settings() {
//size(800,600);
fullScreen(P2D);
}
public void setup(){
}
public void draw(){
background(0);
noFill();
drawCircle(width/2, height/2, 0);
frameRate(30);
}
void drawCircle(int x , int y, float radius){
ellipseMode(CENTER);
rectMode(CENTER);
float off = 1+sin(radians(frameCount/5f));
stroke(89,121,214);
rect(x-radius/2,y-radius/2, radius*off, radius*off);
rect(x+radius/2,y+radius/2, radius*off, radius*off);
rect(x+radius/2,y-radius/2, radius*off, radius*off);
rect(x-radius/2,y+radius/2, radius*off, radius*off);
float step = -PI*10;
if(radius<width/2){
drawCircle(x, y, radius-step);
}
}
@KrabCode
Copy link
Author

obrazek

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment