Created
January 15, 2018 07:24
-
-
Save KrabCode/1203f49db4927de1ceddbd983811a66f to your computer and use it in GitHub Desktop.
squares recursively from zero++ limited by max size
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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); | |
| } | |
| } |
Author
KrabCode
commented
Jan 15, 2018

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