xxxxxxxxxx
112
let moonx=0,moonctr=1;
function setup() {
createCanvas(400, 400);
}
function draw() {
background(10,20,mouseX);
//creating star movement
for(let i=0;i<50;i++){
noStroke();
circle(random(400),random(400),2);
}
fill(255-mouseX);
//moon
stroke(0);
circle(moonx,30,130);
moonx+=moonctr;
if(moonx>width){
moonctr*=-1;
}
if(moonx<0){
moonctr*=-1;
}
//body
rectMode(CENTER);
fill(95,40,176);
rect(200,350,170,200,50);
fill(140,65,60);
arc(200,250,70,80,0,PI);
fill(255);
noStroke();
//neck
fill(140,65,60);
rect(200,251,50,50,20);
stroke(0);
fill(255);
//chain
stroke(0);
strokeWeight(1.3);
noFill();
arc(200,251,50,40,0,PI);
strokeWeight(2);
line(200,272,200,280);
strokeWeight(1);
fill(255);
//head
fill(140,65,60);
rect(200,195,80,110,40);
//ears
arc(239.5,190,22,25,4.7,PI/2);
arc(160.5,190,22,25,1.57,-PI/2);
noFill();
arc(239.5,190,14,12,4.7,PI/2);
arc(160.5,190,14,12,1.57,-PI/2);
fill(255);
//Durag
strokeWeight(2);
fill(0,0,255)
arc(200,176,80,79,PI,0);
beginShape();
curveVertex(165, 176);
curveVertex(160, 176);
curveVertex(239, 176);
curveVertex(239, 176);
endShape();
beginShape();
curveVertex(165, 165);
curveVertex(163, 165);
curveVertex(237, 165);
curveVertex(237, 165);
endShape();
strokeWeight(1);
line(200,137,200,150);
line(200,155,200,165);
fill(255)
//eyes
arc(177,189,19,17,0,PI,CHORD);
fill(0);
circle(175+(0.01*mouseX),193+(0.005*mouseY),9);
arc(177,185,20,5,PI,0,OPEN)
fill(255);
arc(223,189,19,17,0,PI,CHORD);
fill(0);
circle(220+(0.01*mouseX),193+(0.005*mouseY),9);
arc(223,185,20,5,PI,0,OPEN)
fill(255);
//nose
beginShape();
curveVertex(210, 200);
curveVertex(200, 200);
curveVertex(192.62, 215);
curveVertex(192.62, 215);
endShape();
noFill();
arc(199,215,13.6,17,6.7,PI);
//mouth
arc(210,230,17,10,6,PI/1.6)
//shirt text
fill(0);
textSize(20);
textFont('Georgia');
text("Rekas",170,320)
//boarders
fill(0)
rect(0,200,20,401);
rect(400,200,20,401);
rect(200,0,401,50);
rect(200,400,401,120);
fill(255)
}