/* built with Studio Sketchpad:
* https://sketchpad.cc
*
* observe the evolution of this sketch:
* https://dflab.sketchpad.cc/sp/pad/view/ro.fOhQGJJR2em/rev.413
*
* authors:
* Tania Ferrão
* 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, "Modified clone of 'JoaoSerrano -03- fogo all over - a partir de "Aleatoriedade"'", created by Tania Ferrão
// http://dflab.sketchpad.cc/sp/pad/view/ro.9lb4O6PjjM70ue/rev.21
// This sketch builds on a prior work, "JoaoSerrano -03- fogo all over - a partir de "Aleatoriedade"", created by Joao Serrano
// http://dflab.sketchpad.cc/sp/pad/view/ro.9PLf55K06IBEA5/rev.189
/* @pjs preload="/static/uploaded_resources/p.10107/peixe2.jpg"; */
// o movimento aleatório é característico de certos objectos
// (fumo, insectos), etc. e pode ser simulado usando a função random()
PImage peixe2;
float px;
float py;
float jump = 100;
void setup() {
size(500, 500);
background(230,210,0);
peixe2 = loadImage("/static/uploaded_resources/p.10107/peixe2.jpg");
px = random (width);
py = random (height);
}
// 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), 40, width);
float npy = constrain (py + random (-jump, jump), 100, height);
fill(230,210,0,15);
noStroke();
rect (px, py, npx, npy);
fill(208,3,255,5);
noStroke();
ellipse (px, py, npx, npy);
fill(255,0,0,15);
noStroke();
ellipse (px, py, npx, npy);
fill(230,210,0,25);
noStroke();
rect (px, py, npx, npy);
float npx = constrain (px + random (-jump, jump), 20, width);
float npy = constrain (py + random (-jump, jump), 100, height);
image(peixe2, 0, 0, 500,500);
px = npx;
py = npy;
}