/* built with Studio Sketchpad:
* https://sketchpad.cc
*
* observe the evolution of this sketch:
* https://dflab.sketchpad.cc/sp/pad/view/ro.yMuLLBhqNCc/rev.148
*
* authors:
* David Meireles
* license (unless otherwise specified):
* creative commons attribution-share alike 3.0 license.
* https://creativecommons.org/licenses/by-sa/3.0/
*/
// This sketch builds on a prior work, "Pedro Coelho - 02 Movimento", created by pedro coelho
// http://dflab.sketchpad.cc/sp/pad/view/ro.9BjOEcrXQz4Hqt/rev.485
float x = 200;
float y = 0;
float speed = 2;
float acceleration = 0.1;
void setup() {
size(500,500);
frameRate(30);
x = width/2;
y = height/2;
}
void draw() {
x = x + speed;
speed = speed + acceleration;
if (x > height) {
x = 0;
y = y + 50;
}
if (y > width) {
y = 0 }
}
float x = 200;
float y = 0;
float speed = 2;
float acceleration = 0.1;
void setup() {
size(500,500);
frameRate(30);
x = width/2;
y = height/2;
}
void draw() {
fill(255,235,5);
stroke(0,255,0);
rect(y,x,150,50);
fill(255,0,0);
stroke(0,0,235);
ellipse(x,y,150,50);
x = x + speed;
speed = speed + acceleration;
if (x > height) {
x = 0;
y = y + 50;
}
if (y > width) {
y = 0 }
}