/* built with Studio Sketchpad:
* https://sketchpad.cc
*
* observe the evolution of this sketch:
* https://dflab.sketchpad.cc/sp/pad/view/ro.TK37khai49Q/rev.101
*
* authors:
* Mariana Pisa
* license (unless otherwise specified):
* creative commons attribution-share alike 3.0 license.
* https://creativecommons.org/licenses/by-sa/3.0/
*/
/* @pjs preload="http://1.bp.blogspot.com/_ucsME-AsFQU/Sl88mEl7ZeI/AAAAAAAAAlk/v4St3Mwzosk/s800/steven+kenny+109.jpg"; */
float px;
float py;
float jump = 40;
void setup() {
size(373, 500);
textura = loadImage("http://1.bp.blogspot.com/_ucsME-AsFQU/Sl88mEl7ZeI/AAAAAAAAAlk/v4St3Mwzosk/s800/steven+kenny+109.jpg");
px = random (width);
py = random (height);
image (textura, 0, 0, 373, 500);
}
// as instruções que estiverem dentro desta função draw
// são executadas a cada novo frame
void draw() {
float npx = constrain (px + random (-jump, jump), 0, width);
float npy = constrain (py + random (-jump, jump), 0, height);
line (px, py, npx, npy);
line (px, py, npx, npy);
px = npx;
py = npy;
}