/* built with Studio Sketchpad:
* https://sketchpad.cc
*
* observe the evolution of this sketch:
* https://dflab.sketchpad.cc/sp/pad/view/ro.47QNz84EFVm/rev.130
*
* authors:
* Rosmaria Coutinho
* 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, "corar do dia (chorar)", created by TEKOteko
// http://dflab.sketchpad.cc/sp/pad/view/ro.9lbJ$ZY00PuUbe/rev.198
/* @pjs preload="/static/uploaded_resources/p.10335/geometric.jpg"; */
PImage img;
float px;
float py;
void setup() {
//tamanho da tela
size(400, 550);
px = random (width);
py = random (height);
img = loadImage("/static/uploaded_resources/p.10335/geometric.jpg");
image(img, 0, 0, width, height);
}
void draw() {
float npx = constrain (px + random (-10, 10), 0, width);
float npy = constrain (py + random (-10, 10), 0, height);
noStroke();
fill(255,px,10,1);
rect (px, py, npx, npy);
px = npx;
py = npy;
float npx = constrain (px + random (-50, 50), 0, width);
float npy = constrain (py + random (-50, 50), 0, height);
noStroke();
fill(255,px,100,1);
rect (px, py, npx, npy);
}