Created
December 29, 2010 05:52
-
-
Save adenine/758230 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
// 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