Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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
You can’t perform that action at this time.