xxxxxxxxxx
41
class Moon{
constructor(x,y){
this.x = x;
this.y = y;
}
show(){
fill('#fcffa7');
circle(this.x-7,this.y-12,33);
strokeWeight(23);
stroke(246,255,0,5);
let radius = 10;
let numPoints = 150;
let angleIncrement = TWO_PI / numPoints;
for (let i = 0; i < numPoints; i++) {
this.xx = this.x-7 + cos(i * angleIncrement) * radius*1.9;
this.yy = (this.y-12) + sin(i * angleIncrement) * radius*1.9;
let sx = this.xx-(this.x-7);
let sy = this.yy-(this.y-12);
line(this.xx,this.yy,this.xx+sx*8,this.yy+sy*8);
}
stroke(2);
//noStroke();
fill(0);
circle(this.x-7,this.y-12,7);
let r = 255;
let g = 255;
let b = 0;
strokeWeight(1);
noFill();
for(let i = 1; i<100;i++){
stroke(r-i,g-i,b,i/6);
circle(this.x-7,this.y-12,i/2.8);
}
}
}