/* built with Studio Sketchpad:
* https://sketchpad.cc
*
* observe the evolution of this sketch:
* https://studio.sketchpad.cc/sp/pad/view/ro.WxfK4s-UGng/rev.13
*
* authors:
* (Unnamed author)
* Ari Bader-Natal
* 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, "Workshop 3", created by Clarice Chan
// http://ucla.sketchpad.cc/sp/pad/view/ro.4RuFpkMA4aOGXu/rev.3680
PImage img;
float angle = 0.0;
float angle1 = 0;
void setup() {
size(600, 400);
smooth();
frameRate(60);
//Photos
img = loadImage("/static/uploaded_resources/p.916/2111808692_2d558fc8d8.jpg");
img2 = loadImage("/static/uploaded_resources/p.916/218636087_3d7beb10c4.jpg");
img3 = loadImage("/static/uploaded_resources/p.916/391551968_c0456b170e.jpg");
img4 = loadImage("/static/uploaded_resources/p.916/445202788_32475f4bf5.jpg");
img5 = loadImage("/static/uploaded_resources/p.916/179669261_3f9d8e12d6.jpg");
img6 = loadImage("/static/uploaded_resources/p.916/680566152_42831a2d0c.jpg");
img7 = loadImage("/static/uploaded_resources/p.916/2527015009_f5de3f32e6.jpg");
img8 = loadImage("/static/uploaded_resources/p.916/137819120_397fd21ee4.jpg");
img9 =
loadImage("/static/uploaded_resources/p.916/1951437154_9ef1cf5d2e.jpg ");
img10 = loadImage("/static/uploaded_resources/p.916/110307792_5ce40ed11a.jpg");
img11 = loadImage("/static/uploaded_resources/p.916/2699195644_c4e9952bd7.jpg");
img12 = loadImage("/static/uploaded_resources/p.916/156859146_4711474335.jpg");
img13 = loadImage("/static/uploaded_resources/p.916/137819120_397fd21ee4.jpg");
img14 = loadImage("/static/uploaded_resources/p.916/116510493_946d9018d6.jpg");
img15 = loadImage("/static/uploaded_resources/p.916/143029286_a0c67078f7.jpg");
img16 = loadImage("/static/uploaded_resources/p.916/61909797_7d45738543.jpg");
img17 = loadImage("/static/uploaded_resources/p.916/544698886_2ce7968797.jpg"); img18 = loadImage("/static/uploaded_resources/p.916/108899257_4b8ad4b470.jpg");
img19 = loadImage("/static/uploaded_resources/p.916/12d6_1.jpg");
}
void draw() {
background(0);
image(img, 0, 0, 200, 133);
image(img2, 200, 0, 200, 133);
image(img3, 400, 0, 200, 133); // NO NUMBER 4
image(img5, 0, 133, 200, 133);
image(img6, 200, 133, 200, 133);
image(img7, 400, 133, 200, 133);
image(img8, 0, 266, 200, 133);
image(img9, 200, 266, 200, 133);
image(img10, 400, 266, 200, 133);
// change image, grid 1
if ((mouseX < 200) && (mouseX > 0) && (mouseY < 133) && (mouseY > 0)) {
image(img11, 0, 0, 200, 133);
}
// spaz, grid 2
if ((mouseX < 400) && (mouseX > 200) && (mouseY < 133) && (mouseY > 0)) {
int x = (int) random(1, 9);
switch(x) {
case 1: image(img11, 200, 0, 200, 133);
break;
case 2: image(img12, 200, 0, 200, 133);
break;
case 3: image(img13, 200, 0, 200, 133);
break;
case 4: image(img14, 200, 0, 200, 133);
break;
case 5: image(img15, 200, 0, 200, 133);
break;
case 6: image(img16, 200, 0, 200, 133);
break;
case 7: image(img17, 200, 0, 200, 133);
break;
case 8: image(img18, 200, 0, 200, 133);
break;
case 9: image(img19, 200, 0, 200, 133);
break;
}
}
//rotate, grid 3
if ((mouseX < 600) && (mouseX > 400) && (mouseY < 133) && (mouseY > 0)) {
rect(400, 0, 200, 133);
fill(0);
translate(500, 66.5);
rotate(angle);
image(img3, -100, -66.5, 200, 133);
angle += (0.1);
}
//invert, grid 4
if ((mouseX < 200) && (mouseX > 0) && (mouseY < 266) && (mouseY > 133)) {
image(img19, 0, 133, 200, 133)
}
//curser, grid 5
if ((mouseX < 400) && (mouseX > 200) && (mouseY < 266) && (mouseY > 133)) {
rect(200, 133, 200, 133);
fill(0, 0 ,0);
image(img6, (mouseX-100), (mouseY-66.5), 200, 133);
}
//scale, grid 6
if ((mouseX < 600) && (mouseX > 400) && (mouseY < 266) && (mouseY > 133)) {
rect(400, 133, 200, 133);
fill(0);
scale(0.5);
translate(500,200);
image(img7, 400, 133, 200, 133);
}
//SWITCH WITH GRID 9, grid 7
if ((mouseX < 200) && (mouseX > 0) && (mouseY < 400) && (mouseY > 266)) {
image(img10, 0, 266, 200, 133);
image(img8, 400, 266, 200, 133);
}
//seesaw back and forth, grid 8
if ((mouseX < 400) && (mouseX > 200) && (mouseY < 400) && (mouseY > 266)) {
float img9X = cos(angle1) * 100; //the 100 means the distance side to side
angle1 += 0.05; //the 0.05 is the speed it jolts/frequency
rect(200, 266, 200, 133);
fill(0, 0, 0);
image(img9, (width/2 + img9X - 100), (height/2 + 66.5), 200, 133);
}
//SWITCH WITH GRID 7, grid 9
if ((mouseX < 600) && (mouseX > 400) && (mouseY < 400) && (mouseY > 266)) {
image(img10, 0, 266, 200, 133);
image(img8, 400, 266, 200, 133);
}
}