Press the up arrow to change the color of the shoes.Press the down arrow to change the color of the top. Press the right arrow to change the color of the skirt
xxxxxxxxxx
var skirtR
var skirtG
var skirtB
var topR
var topG
var topB
var lShoeR
var lShoeG
var lShoeB
var rShoeR
var rShoeG
var rShoeB
function setup() {
createCanvas(700, 400);
rectMode(CENTER)
skirtR = 255
skirtG = 255
skirtB = 255
topR = 255
topG = 255
topB = 255
lShoeR = 255
lShoeG = 255
lShoeB = 255
rShoeR = 255
rShoeG = 255
rShoeB = 255
}
function draw() {
background(220);
width = 0
counter = 0
while(width <= 700){
if (counter % 2 == 0)
{
fill(149,191,116)
}
else if (counter % 2 != 0)
{
fill(21,121,110)
}
quad(width,0,width,400,width + 50,400,width + 50,0)
width = width + 50
counter = counter + 1
}
fill(143,91,29)
//legs
rect(330,360,20,80)
rect(370,360,20,80)
//torso
quad(320,280,380,280,380,210,320,210)
strokeWeight(3)
//belly button
point(350,270)
strokeWeight(1)
//shooulders
rect(350,220,60,40,10)
//left arm
//outfit
fill(skirtR,skirtG,skirtB)
var skirt = quad(300,320,400,320,380,280,320,280)
fill(topR,topG,topB)
var top = quad(320,260,380,260,380,220,320,220)
fill(lShoeR,lShoeG,lShoeB)
var lShoe = ellipse(320,395,45,30)
var rShoe = ellipse(380,395,45,30)
}
function keyPressed() {
if (keyCode == RIGHT_ARROW)
{
skirtR = random(0,140)
skirtG = 29
skirtB = random(0,143)
}
if (keyCode == UP_ARROW)
{
lShoeR = random(50,140)
rShoeR = random(50,140)
lShoeG = 29
rShoeG = 29
lShoeB = random(50,143)
rShoeB = random(50,143)
}
if (keyCode == DOWN_ARROW)
{
topR = random(50,140)
topG = 29
topB = random(50,143)
}
}