//Title: Candle Summon
//By: Nikki Arezza [991394321]
//Desciption:
//-In this program you can interact with the candle by making it "melt" and also regenerate it
//-Upon mouse click you can "summon" a creature while simultaniously changing the chalk marks red
//The candle flame also flickers on it's own
void setup() {
size(400, 400); //sets size of program
noCursor(); //omits cursor icon when in program
}//end of setup() routine
void draw() {
background(0); //sets background colour to black
//TABLE//
//Surface of Table
noStroke();
fill(82, 50, 10); //sets colour to lighter brown
rectMode(CORNERS);
rect(0, 240, 400, 400);
//Front Side of Table
fill(52, 31, 7);
rectMode(CORNERS);
rect(0, 360, 400, 400); //sets colour to darker shade of brown
//CHALK//
//Outer Rings
noFill();
strokeWeight(1);
stroke(255, 240, 152, 100);
ellipse(200, 300, 300, 80);
ellipse(200, 300, 290, 70);
//Pentagram
line(140, 268, 345, 300);
line(280, 270, 56, 300);
line(345, 300, 56, 300);
line(140, 268, 200, 335);
line(280, 270, 200, 335);
//CANDLE SHADOW//
noStroke();
fill(23, 16, 0, 191);
ellipse(205, 295, 60, 20); //sets candle to a darker yellowish hue
//CANDLE BODY//
noStroke();
fill(160, 154, 102);
//Body
rectMode(CORNERS);
rect(180, mouseY/1.5, 230, 290); //allows candle to grow/melt
//Bottom
ellipse(205, 286, 50, 25); //affixes bottom of candle to the table
//Surface
fill(180, 240, 202); //changes surface colour to a lighter shade
ellipse(205, mouseY/1.5, 50, 20); //allows candle to grow/melt
//FLAME//
//Yellow Orb
noStroke();
fill(255, 240, 152, 190);
ellipse(205, mouseY/1.5-40+random(5), 25, 90); //follows candle and subtle flame vibration
//Orange Orb
fill(155, 60, 2, 127);
ellipse(205, mouseY/1.5-20+random(3), 20, 45); //follows candle and subtle flame vibration decreased
//Blue Orb
fill(0, 25, 144, 100);
ellipse(205, mouseY/1.5-10+random(2), 13, 22); //follows candle and subtle flame vibration decreased further
//Wick
fill(0);
rectMode(CENTER);
rect(205, mouseY/1.5-5, 1, 16);
}//end of draw() routine
void mousePressed() {
//DEMON//
noStroke();
fill(152, 39, 2, 191); //sets demon and chalk blood tone to dark red
//Left Eye
triangle(mouseX-20, mouseY-30, mouseX-40, mouseY-50, mouseX-50, mouseY-100);
//Right Eye
triangle(mouseX+20, mouseY-30, mouseX+40, mouseY-50, mouseX+50, mouseY-100);
//Mouth
quad(mouseX-20, mouseY, mouseX+20, mouseY, mouseX+30, mouseY+10, mouseX-30, mouseY+10);
triangle(mouseX+30, mouseY+10, mouseX-30, mouseY+10, mouseX, mouseY+100);
//CHALK-TO-BLOOD//
noFill();
strokeWeight(1);
stroke(152, 39, 2); //Changes colour to Red
//Outer Rings
ellipse(200, 300, 300, 80);
ellipse(200, 300, 290, 70);
//Pentagram
line(140, 268, 345, 300);
line(280, 270, 56, 300);
line(345, 300, 56, 300);
line(140, 268, 200, 335);
line(280, 270, 200, 335);
}//end of mousePressed() routine