var skinR = 201;
var skinG = 143;
var skinB = 101;
var rectX = 350;
var rectY = 200;
var rectWidth = 150;
var rectHeight = 230;
var mouthW = 50;
var mouthH = 50;
var eyeW = 40;
var eyeH = 20;
var pt = 18;
var personas = ["JOE likes raw vegetables and long walks on the beach", "JOEY like iced green tea and planning weddings", "JOESEPH likes tofu turkey and Nathan Lane movies", "JOLENE likes peanut butter cups and Tibetan arts and crafts", "JOANNE likes lavendar hand cream and red neon lights", "JOESEPHINE likes spicy oats and museum gift shops", "JOAN likes candied pineapple and matcha espresso fusions", "JOEL likes caramel custard and hot wheels", "JOHANNES likes exposed red brick walls and blue turtlenecks"];
var index = 0;
function setup() {
createCanvas (640,480);
background(255,233,10);
}
function draw() {
background(255,233,10);
//body
fill(skinR, skinG, skinB);
stroke (220,120,40);
strokeWeight(10);
rect(rectX, rectY, rectWidth, rectHeight);
//mouth
fill (255,0,0);
noStroke();
arc(rectX + 40, rectY+50,
mouthW + 10, mouthH +40, 0, 2*HALF_PI);
//teeth
fill (240);
arc(rectX + 40, rectY+50,
mouthW + 10, mouthH - 20, 0, 2*HALF_PI);
//eye1
fill(255);
noStroke();
ellipse(rectX+30, rectY+20, eyeW, eyeH);
fill(0);
noStroke();
ellipse(rectX+30, rectY+20, eyeH, 15);
//eye2
fill(255);
noStroke();
ellipse(rectX+90, rectY+20, eyeW, eyeH);
fill(0);
noStroke();
ellipse(rectX+90, rectY+20, eyeH, 15);
//personas
fill(50);
textFont("Georgia");
textSize(pt);
text(personas[index], 100, 100);
}
function mousePressed (){
//changing skin colour
skinR = random(200,80);
skinG = random (90,90);
skinB = random (101,40);
//changing body proportions
rectX = random(150,450);
rectY = random(150,300);
rectWidth = random (150,200);
rectHeight = random (150, 400);
//changing eye proportions
eyeW = random (30,70);
eyeH = random (20,30);
//changing mouth proportions
mouthH = random (10,200);
mouthW = random (10,200);
//persona generator
index = index + 1;
if (index == personas.length) {
index = 0;
}
}
I wanted to have fun with the Project and so I decided to make characters out of my different faces. I like how each face has a fun, kind of weird but unique personality. I thought they all looked like “Joes” so I made them all pretty similar. I started off wanting to do really complicated things that I had to simplify but it was a good opportunity to play with p5.js, experiment and learn about arrays.