void_setup
by mingjian sun
HTML
<script src="https://cdnjs.cloudflare.com/ajax/libs/p5.js/0.6.1/p5.js"></script>
JavaScript
function setup() {
createCanvas(400, 400);
}
var a = 0.0;
function draw() {
fill("rgba(2,16,80,0.05)");
rect(0, 0, width, height);
translate(200 + a * 10, 200 + a * 10);
rotate(a);
scale(a / 15);
a += 0.05;
kao(0, -50.0);
kao(1, 50.0);
if (a > 30) a -= 50;
}
//魔法の筆 呪文で絵描くよ 君も描こう!
function kao(don, b) {
stroke(0);
strokeWeight(2);
fill("#e7eedd");
ellipse(b, 0, 50, 50);
noStroke();
fill(!don ? "#68c0c0" : "#fb4828");
ellipse(b, 0, 38, 38);
stroke(0);
strokeWeight(1.4);
arc(b + 4.26, 5, 8.5, 7.3, 0.3, PI, OPEN);
arc(b - 4.26, 5, 8.5, 7.3, 0, PI - 0.3, OPEN);
fill(0);
ellipse(b - 11, -2, 6.56, 7);
ellipse(b + 11, -2, 6.56, 7);
}
//世界が始まるよーーー