ICM #2 Painstaking Cemetary

I built upon the 1st assignment, making the eyeballs and mouth melt across and down the canvas. I wrote a sun to run randomly and change everytime the script ran. When the mouse moved one of the eyeballs trails across x and y axis with the background not refreshing. When the mouse is clicked the background, nose and mouth change color and the trailing eyes reset. I most likely have some lines in the code that aren’t doing anything as well.

http://alpha.editor.p5js.org/Nire/sketches/SJ6l7EliZ

var eyeballs = 150;
var col = {
r: 255,
g: 0,
b: 0
}

function setup() {
createCanvas(550, 650);
rectMode(CENTER);

background(21,20,250);

// Body
colorMode(230, 0, 80, 100);
stroke(270, 250, 100, 600)
fill(255, 0, 0, 250);
rect(270, 250, 100, 600);

// Eyes
fill(‘rgb(255,634,63)’);
ellipse(150, 115, 200, 100);
ellipse(150, 230, 200, 100);
ellipse(400, 115, 200, 100);
ellipse(400, 230, 200, 100);
ellipse(150, 345, 200, 100);
ellipse(400, 345, 200, 100);

//Lips
fill(250, 0, 150, 220)
ellipse(275, 520, 300, 100);

// Eyes
fill(30);
ellipse(150, 115, 90, 80);
ellipse(eyeballs, 250, 90, 80);
ellipse(400, 115, 90, 80);
ellipse(400, 250, 90, 80);
ellipse(150, 345, 90, 80);
ellipse(400, 345, 90, 80);

}
function draw() {
col = mouseX/2
col.r = random(100, 255);
col.g = 0;
col.b = random(100, 190);
var x = random(width);
var y = random(height)

var r = random(255);
var g = random(255);
var b = random(255);

fill(r, g, b, 100);
triangle(x, y, 0, 0);

// Eyes
fill(‘rgb(255,634,63)’);
ellipse(mouseX, mouseY, 200, 100);
ellipse(eyeballs, 230, 200, 100);
ellipse(400, 115, 200, 100);
ellipse(400, 230, 200, 100);
ellipse(eyeballs, 345, 200, 100);
ellipse(400, 345, 200, 100);

//Lips
fill(eyeballs, 0, 150, 220)
ellipse(eyeballs, 520, 300, 100);

// Eyes
fill(30);
ellipse(mouseX, mouseY, 90, 80);
ellipse(150, eyeballs, 90, 80);
ellipse(400, eyeballs, 90, 80);
ellipse(400, 250, 90, 80);
ellipse(150, 345, 90, 80);
ellipse(400, 345, 90, 80);

eyeballs = eyeballs + 1;
}

function mousePressed() {
createCanvas(550, 650);
rectMode(CENTER);

background(200,20,250);

// Body
colorMode(230, 200, 80, 100);
stroke(270, 250, 100, 600)
fill(200, 150, 0, 150);
rect(270, 250, 100, 600);

// Eyes
fill(‘rgb(255,634,63)’);
ellipse(150, 115, 200, 100);
ellipse(150, 230, 200, 100);
ellipse(400, 115, 200, 100);
ellipse(400, 230, 200, 100);
ellipse(150, 345, 200, 100);
ellipse(400, 345, 200, 100);

//Lips
fill(250, 250, 150, 120)
ellipse(275, 520, 300, 100);

// Eyes
fill(30);
ellipse(150, 115, 90, 80);
ellipse(150, 250, 90, 80);
ellipse(400, 115, 90, 80);
ellipse(400, 250, 90, 80);
ellipse(150, 345, 90, 80);
ellipse(400, 345, 90, 80);
}

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s