Created
March 31, 2019 20:59
-
-
Save Introscopia/c9d60fbbd8f6417a6829e60d0232c1e0 to your computer and use it in GitHub Desktop.
This file contains 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
float theta; | |
boolean over; | |
void setup() { | |
size(400, 400); | |
theta = HALF_PI; | |
over = true; | |
} | |
void draw() { | |
background(0); | |
float bx = 200 + cos( theta ) * 150; | |
float by = 200 + sin( theta ) * 20; | |
float bd = 35 / (-sin(theta)+2); | |
if( !over ){ | |
fill(#3DC6FA); | |
ellipse( bx, by, bd, bd ); | |
} | |
fill(#FFAA3B); | |
ellipse( 200, 200, 170, 170 ); | |
if( over ){ | |
fill(#3DC6FA); | |
ellipse( bx, by, bd, bd ); | |
} | |
float pt = theta; | |
theta += 0.02; | |
if ( theta > PI && pt < PI ) { | |
over = false; | |
} else if ( theta > TWO_PI ) { | |
theta = 0; | |
over = true; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment