Moody Face

Using conditional statements to loop through an array of moods and render the appropriate face based on mouse position.

All the feelings.
def setup():
size(600, 600)
background(83, 139, 173)

global moods
moods = ['happy', 'bored', 'sad', 'sick']

# variables / dictionaries
faceShapes = {
'eyeRadius': 20,
'eyeYPosition': 280,
'leftEyeXPosition': 260,
'rigthEyeXPosition': 340
};
def draw():
# variables
headWidthHeight = width/3
yLocation = 50
# faceMood = 'normal'
# head
noStroke()
fill(224, 130, 131)
ellipse(width/2, height/2, headWidthHeight, headWidthHeight)
strokeWeight(8)

# left eye
fill('#F2F2F2');
ellipse(faceShapes['leftEyeXPosition'], faceShapes['eyeYPosition'], 40, 30);
fill(147, 71, 72)
ellipse(faceShapes['leftEyeXPosition'], faceShapes['eyeYPosition'], faceShapes['eyeRadius'], faceShapes['eyeRadius'])

# right eye
fill('#F2F2F2');
ellipse(faceShapes['rigthEyeXPosition'], faceShapes['eyeYPosition'], 40, 30);
fill(147, 71, 72)
ellipse(faceShapes['rigthEyeXPosition'], faceShapes['eyeYPosition'], faceShapes['eyeRadius'], faceShapes['eyeRadius'])

if mouseX < 150:
faceMood = moods[0]
elif mouseX < 300:
faceMood = moods[1]
elif mouseX < 450:
faceMood = moods[2]
else:
faceMood = moods[3]

if faceMood == 'happy':
noFill()
stroke(147, 71, 72);
arc(width/2, (height/2)+20, 80, 80, 0, PI);
elif faceMood == 'bored':
stroke(147, 71, 72);
line(260, 340, 340, 340)
elif faceMood == 'sad':
noFill()
stroke(147, 71, 72)
arc(width/2, (height/2)+60, 80, 80, PI, TWO_PI)
else:
stroke(147, 71, 72)
line(260, 330, 280, 360)
line(280, 360, 300, 330)
line(300, 330, 320, 360)
line(320, 360, 340, 330)
One clap, two clap, three clap, forty?

By clapping more or less, you can signal to us which stories really stand out.