/* built with Studio Sketchpad:
* https://sketchpad.cc
*
* observe the evolution of this sketch:
* https://fgcs.sketchpad.cc/sp/pad/view/ro.3YO1k0bJ8oT/rev.401
*
* authors:
* Markus Roberts
* license (unless otherwise specified):
* creative commons attribution-share alike 3.0 license.
* https://creativecommons.org/licenses/by-sa/3.0/
*/
// Pressing Control-R will render this sketch.
PImage kitten_picture;
int top,bottom,left,right;
void setup() {
size(500, 500);
frameRate(30);
kitten_picture = loadImage("http://freshpet.com/wp-content/uploads/2015/04/kitten-1024x640.jpg");
// start with the image zoomed to 2x the window size & centered
left = -0.5*width;
top = -0.5*top;
bottom = 1.5*height;
right = 1.5*width;
}
void draw() {
background(64,150,64); // green
image(kitten_picture,left,top,right,bottom);
// randomly move the edges of the picture
left += random(-5,5);
top += random(-5,5);
bottom += random(-5,5);
right += random(-5,5);
}