Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // 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);
- }
Add Comment
Please, Sign In to add comment