sketch.js
function setup() {
createCanvas(600, 600); //ウィンドウサイズの指定
background(255, 51, 102);
}
function draw() {
fill(253, 239, 242);
circle(450, 200, 650); //でかい顔
circle(95, 500, 300); //小さい顔
strokeWeight(2);
stroke(0, 139, 139);
angleMode(DEGREES);
arc(250, 250, 130, 140, 180, 360);
arc(450, 250, 130, 140, 180, 360);
strokeWeight(1);
fill(36, 219, 232);
circle(250, 250, 100); //お目目
circle(450, 250, 100); //お目目
fill(0, 139, 139);
circle(80, 470, 13);
circle(130, 470, 13);
line(300, 350, 350, 400);
line(350, 400, 400, 350);
fill(255, 255, 255);
beginShape();
vertex(250, 200); //上
vertex(200, 250); //左
vertex(250, 300); //した
vertex(300, 250); //右
endShape(CLOSE);
beginShape();
vertex(450, 200); //上
vertex(400, 250); //左
vertex(450, 300); //した
vertex(500, 250); //右
endShape(CLOSE);
fill(0, 136, 153);
ellipse(550, 0, 600, 300);
fill(255, 255, 255);
rect(460, 50, 50, 100);
}
function mousePressed() {
//マウスのボタンが押し下げられた時の処理
}
function mouseReleased() {
//マウスのボタンが離された時の処理
}
function keyPressed() {
if (key == "s") {
saveCanvas();
}
}