xxxxxxxxxx
131
let circleD = 1;
let growing = true;
function setup() {
createCanvas(400, 400);
}
function draw() {
background(255);
//line(200,130,200,280); //body
//line(150,250,200,175);
//line(200,175,250,250);
//line(200,280,150,350);
//line(200,280,250,350);
// circle(175,70,20);
//sky
noStroke()
fill(135,206,250)
rect(0,0,400,250)
//sky
noStroke()
fill(135,206,250)
rect(0,0,400,250)
fill(255,233,34);
circle(0,0,250); //sun
triangle(0,125,10,150,20,123)
triangle(20,123,30,140,40,118)
triangle(40,118,57,145,60,109)
triangle(60,108,83,120,80,96)
triangle(80,96,120,110,100,76)
triangle(100,76,134,70,115,45)
triangle(115,45,145,40,115,5)
triangle(115,30,145,10,122,0)
if (mouseIsPressed){
//nightsky
fill(40)
rect(0,0,400,250)
fill(190)
//moon
circle(0,0,250)
fill(240)
circle(30,24,30)
fill(230)
circle(16,81,15)
fill(215)
circle(48,83,20)
fill(242)
circle(87,19,15)
fill(250)
circle(70,50,30)
print(mouseX,mouseY)
//stars
fill(255)
circleD=random(1,3)
if (growing) {
circleD += 1;
if (circleD >= 5) {
growing = false;
}
} else {
circleD -= 1;
if (circleD <= 1) {
growing = true;
}
}
noStroke()
circle(294,25,circleD)
circle(187,42,circleD)
circle(361,52,circleD)
circle(218,9,circleD)
circle(276,115,circleD)
circle(279,70,circleD)
circle(355,85,circleD)
circle(133,91,circleD)
circle(215,85,circleD)
circle(245,23,circleD)
circle(335,15,circleD)
circle(316,81,circleD)
}
//ground
noStroke()
fill(203,189,147)
rect(0,250,400,150)
//body
fill(87,8,168)
ellipse(200,400,180,380)
stroke(1)
fill(229,194,152);
ellipse(200,200,120,130); //face
noFill()
fill(226,185,143)
triangle(195,205,205,205,200,195) //nose
fill(255)
ellipse(180,175,20,10)
ellipse(220,175,20,10)
fill(0)
circle(180,175,9); //L.eye
circle(220,175,9) ; //R.eye
//hair
arc(200,131,80,70,0.4,PI-0.4)
circle(200,130,25)
//mouth
noFill()
arc(200,200,60,70,0.4,PI-0.4)
//NYU
fill(255)
textAlign(CENTER,CENTER)
textSize(50)
text('NYU',200,310)
}