Skip to content

Instantly share code, notes, and snippets.

@Introscopia
Created March 31, 2019 20:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Introscopia/c9d60fbbd8f6417a6829e60d0232c1e0 to your computer and use it in GitHub Desktop.
Save Introscopia/c9d60fbbd8f6417a6829e60d0232c1e0 to your computer and use it in GitHub Desktop.
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