/* built with Studio Sketchpad:
* https://sketchpad.cc
*
* observe the evolution of this sketch:
* https://bard117f12.sketchpad.cc/sp/pad/view/ro.Wwj$TJwgCqG/rev.177
*
* authors:
* Robert Hinton
* license (unless otherwise specified):
* creative commons attribution-share alike 3.0 license.
* https://creativecommons.org/licenses/by-sa/3.0/
*/
// This sketch differs from my design blocks sketch in that it is interactive. Also, the overall design is more complex. The user experiences time over a series of clicks whereas in design blocks the user's interpretation of time was based on flashing squares and light rather than interactivity//
/* @pjs preload="/static/uploaded_resources/p.6486/SPBackground.jpg"; */
PImage img;
void setup()
{
size(800, 800);
img=loadImage("/static/uploaded_resources/p.6486/SPBackground.jpg");
noStroke();
smooth();
image(img, 0, 0);
}
// Drips
void draw() {
fill(180, 0, 115);
float drip = int (random(10));
ellipse(mouseX, mouseY, drip, drip);
}
// Cool, Do it again!
void mousePressed() {
drawCircles(400, 400, 100, 10);
}
// Circle splatter machine
void drawCircles(float x, float y, int radius, int level)
{
noStroke();
float tt = 126 * level / 6.0;
fill (tt, 0, 116);
ellipse(x, y, radius*2, radius*2);
if (level > 1) {
level = level - 1;
int num = int (random(2, 5));
for(int i=0; i<num; i++) {
float a = random(0, TWO_PI);
float nx = x + cos(a) * 6.0 * level;
float ny = y + sin(a) * 6.0 * level;
drawCircles(nx, ny, radius/2, level);
}
}
}