Skip to content

Instantly share code, notes, and snippets.

@adenine
Created December 29, 2010 05:52
Show Gist options
  • Save adenine/758230 to your computer and use it in GitHub Desktop.
Save adenine/758230 to your computer and use it in GitHub Desktop.
// DOT EXERCISE
// THISNEWMEDIA.TUMBLR.COM
float yPos;
int myHeight = 800;
int myWidth = 400;
float speed = 0;
float gravity = 0.1;
void setup() {
size(800,400);
background(120);
smooth();
}
void draw() {
background(120);
noStroke();
yPos+=speed;
speed+=gravity;
if (yPos > height || yPos < 0) {
speed = speed * -0.95;
}
ellipse(width/2,yPos,40,40);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment