sketch.js
function setup() {
createCanvas(600, 600); //ウィンドウサイズの指定
background(39, 109, 97); //背景色を指定して1回だけ塗る。
stroke(0, 0, 255);
fill(240, 255, 39);
noStroke();
ellipse(300, 300, 450, 520);
fill(99, 0, 0);
triangle(80, 320, 300, 350, 520, 320);
fill(0, 0, 0);
ellipse(270, 90, 10, 30);
ellipse(330, 90, 10, 30);
fill(255, 255, 255);
ellipse(120, 70, 100, 50);
ellipse(480, 70, 100, 50);
stroke(0, 0, 0);
line(70, 70, 170, 70);
line(430, 70, 530, 70);
fill(0, 0, 0);
circle(120, 70, 30);
circle(480, 70, 30);
noStroke();
fill(255, 255, 255);
rect(100, 51, 40, 18);
rect(460, 51, 40, 18); //目
}
function draw() {
// background(0, 0, 0); //背景色を指定して1回だけ塗る。
}
function mousePressed() {
//マウスのボタンが押し下げられた時の処理
}
function mouseReleased() {
//マウスのボタンが離された時の処理
}
function keyPressed() {
if (key == "s") {
saveCanvas();
}
}