// Week 4 Asignment // Layers two images on top of eachother and when mouse clicked // it flashes both images and places color tint over bottom image // Author: Josh Stinson // Class: PUDT 1203 Creative Computing PImage img; void setup() { size(655, 370); background(255); } // draws "scope sights" on screen that follow mouse movements. Partial code for // moving lines borrowed from class blog, but edited and adjusted by me. void draw() { stroke(0); line(mouseX, 0, mouseX, 600); line(0, mouseY, 700, mouseY); ellipse(mouseX, mouseY, 40, 40); // laying down base image and tint to strobe when mouse is pressed. ellipse(mouseX, mouseY , 20, 20); img = loadImage("AokiElektro2.jpg"); if(mousePressed == true){ tint(random(10, 250), random(10, 250), random(10, 250), 200); image(img, 0, 0); } else { fill(255); noStroke(); } // Top image to be displayed when mouse is not pressed img = loadImage("AokiElektro.jpg"); image(img, 0, 0); // When any key is pressed the scope will turn red. if (keyPressed == true) { fill(255, 0, 0); } else { fill(255); } ellipse(mouseX, mouseY , 10, 10); }