/* Haunted Frame by Giuliano Patricelli Intract by moving the mouse in all directions Be sure to click the mouse! */ void setup() { // set size to 400 by 400 pixles size(400,400); // set rectangle mode to corners rectMode(CENTER); } void draw() { // set background color to red background(200,24,57); // set to a smooth 60 fps frameRate(60); // draw health icon noStroke(); fill(255,0,0); rect(237 + (mouseX * 0.30),200,20,50); rect(237 + (mouseX * 0.30),200,50,20); // draw scary triangle fill(200,200,0); triangle(200,207 + (mouseY * 0.30),240,257 + (mouseY * 0.30),160,257 + (mouseY * 0.30)); fill(255); ellipse(200,237 + (mouseY * 0.30),45,20); fill(0); ellipse(200,237 + (mouseY * 0.30),15,15); // draw skull fill(255); ellipse(45 + (mouseX * 0.30),195,55,55); rect(45 + (mouseX * 0.30),220,30,45); fill(0); ellipse(31 + (mouseX * 0.30),195,20,30); ellipse(59 + (mouseX * 0.30),195,20,30); // draw coin fill(178,162,51); ellipse(200,40 + (mouseY * 0.30),60,60); fill(255,215,0); ellipse(200,40 + (mouseY * 0.30),50,50); fill(0); rect(200,40 + (mouseY * 0.30),5,30); // draw frame border fill(172,160,60); noStroke(); rect(200,200,240,240); // draw mirror fill(180); stroke(2); rect(200,200,220,220); // vampire head noStroke(); fill(241); ellipse(180 + mouseX/8.3,180 + mouseY/8.3,110,110); // teeth stroke(0); strokeWeight(2); triangle(170 + mouseX/8.3,215 + mouseY/8.3,180 + mouseX/8.3,215 + mouseY/8.3,175 + mouseX/8.3,225 + mouseY/8.3); triangle(180 + mouseX/8.3,215 + mouseY/8.3,190 + mouseX/8.3,215 + mouseY/8.3,185 + mouseX/8.3,225 + mouseY/8.3); // eye 1 stroke(0); fill(200,0,0); ellipse(200 + mouseX/8.3,175 + mouseY/8.3,23,42); // eye 2 stroke(0); fill(200,0,0); ellipse(160 + mouseX/8.3,175 + mouseY/8.3,23,42); // pupils fill(0); ellipse(195 + mouseX/6.7,170 + mouseY/6.7,8,8); ellipse(155 + mouseX/6.7,170 + mouseY/6.7,8,8); // mouth line(165 + mouseX/8.3,215 + mouseY/8.3,195 + mouseX/8.3,215 + mouseY/8.3); line(164 + mouseX/8.3,219 + mouseY/8.3,164 + mouseX/8.3,210 + mouseY/8.3); line(196 + mouseX/8.3,219 + mouseY/8.3,196 + mouseX/8.3,210 + mouseY/8.3); } // when mouse is pressed void mousePressed(){ // framerate set to 2 to cause screen to freeze frameRate(2); // output the text Boo! println("Boo!"); // set background to black background(0); // make teeth red fill(200,0,0); stroke(0); strokeWeight(2); triangle(170 + mouseX/8.3,215 + mouseY/8.3,180 + mouseX/8.3,215 + mouseY/8.3,175 + mouseX/8.3,225 + mouseY/8.3); triangle(180 + mouseX/8.3,215 + mouseY/8.3,190 + mouseX/8.3,215 + mouseY/8.3,185 + mouseX/8.3,225 + mouseY/8.3); // red eye 1 stroke(0); fill(200,0,0); ellipse(200 + mouseX/8.3,175 + mouseY/8.3,23,42); // red eye 2 stroke(0); fill(200,0,0); ellipse(160 + mouseX/8.3,175 + mouseY/8.3,23,42); }