xxxxxxxxxx
200
var clouds = [];
// var breath = [];
function setup() {
createCanvas(400, 600);
colorMode(RGB, 255, 255, 255, 1);
}
function draw() {
background(random(255), 255, 255);
// display
for (i = 0; i < clouds.length; i++) {
var currentObj = clouds[i];
cloud(currentObj.xpos, currentObj.ypos, currentObj.size);
currentObj.xpos += 0.5;
currentObj.ypos += random(-0.5, 0.5);
if (clouds[i].xpos > width+20) {
clouds.splice(i, 1);
}
}
//tail
fill(125, 75, 200);
stroke(125, 4, 200);
strokeWeight(3);
quad(220, 450, 300, 400, 280, 380, 300, 370,270, 370);
// Right_Wing
noStroke()
fill(125, 4, 235);
var pr1 = {
x: 220,
y: 245
},
pr2 = {
x: 380,
y: 350
};
var pr3 = {
x: 330,
y: 200
},
pr4 = {
x: 220,
y: 245
};
quad(pr1.x, pr1.y, pr2.x, pr2.y, pr3.x, pr3.y, pr4.x, pr4.y);
// Left_Wing
noStroke()
fill(125, 4, 235);
var pl1 = {
x: 180,
y: 245
},
pl2 = {
x: 20,
y: 350
};
var pl3 = {
x: 70,
y: 200
},
pl4 = {
x: 180,
y: 245
};
quad(pl1.x, pl1.y, pl2.x, pl2.y, pl3.x, pl3.y, pl4.x, pl4.y);
//body
noStroke()
fill(125, 75, 200);
ellipse(200, 340, 120, 300);
noFill();
stroke(125, 4, 235);
strokeWeight(3);
rect(175, 255, 50, 20, 10);
rect(170, 285, 60, 20, 10);
rect(165, 315, 70, 20, 10);
rect(160, 345, 80, 20, 10);
rect(165, 375, 70, 20, 10);
rect(170, 405, 60, 20, 10);
rect(175, 435, 50, 20, 10);
//legs
noStroke()
fill(125, 4, 200);
ellipse(180, 490, 35, 60);
ellipse(220, 490, 35, 60);
//feet
fill(125, 75, 200);
ellipse(170, 510, 35, 35);
ellipse(230, 510, 35, 35);
//arms
noStroke()
fill(125, 4, 200);
ellipse(140, 320, 25, 60);
ellipse(260, 320, 25, 60);
//hands
fill(125, 75, 200);
ellipse(140, 330, 20, 25);
ellipse(260, 330, 20, 25);
//head
noStroke()
fill(125, 4, 200);
ellipse(200, 160, 150, 100);
//ears
fill(125, 4, 200);
triangle(155, 130, 195, 130, 180, 75);
triangle(210, 130, 250, 130, 225, 75);
fill(100, 4, 200);
triangle(170, 110, 185, 110, 180, 95);
triangle(220, 110, 235, 110, 225, 95);
//nose
fill(125, 4, 200);
//ellipse(200, 200, 70, 60);
arc(200, 200, 80, 80, 0, PI, OPEN);
fill(0);
ellipse(185, 215, 10, 20);
ellipse(215, 215, 10, 20);
//eyes
fill(150);
ellipse(175, 155, 20, 30);
ellipse(225, 155, 20, 30);
fill(0, 255, 165);
ellipse(175, 155, 10, 10);
ellipse(225, 155, 10, 10);
//smoke_left
fill(255, 100, 40);
strokeWeight(15);
stroke(255, 100, 40, .5);
ellipse(185, 231, 20, 15);
ellipse(180, 248, 30, 20);
ellipse(170, 272, 40, 30);
//smoke_right
ellipse(215, 231, 20, 15);
ellipse(220, 248, 30, 20);
ellipse(230, 272, 40, 30);
}
function cloud(x, y, size) {
fill(255, 255, 255);
noStroke();
arc(x, y, 25 * size, 20 * size, PI + TWO_PI, TWO_PI);
arc(x + 10, y, 25 * size, 45 * size, PI + TWO_PI, TWO_PI);
arc(x + 25, y, 25 * size, 35 * size, PI + TWO_PI, TWO_PI);
arc(x + 40, y, 30 * size, 20 * size, PI + TWO_PI, TWO_PI);
}
function mousePressed() {
var newCloud = {
xpos: mouseX,
ypos: mouseY,
size: random(.5, 5)
};
clouds.push(newCloud);
var fireBreath = {
xpos: mouseX,
ypos: mouseY,
}
// var wingsFly = {
// xpos:
}