by Ingram chung
let x, y;
var stars = [];
function setup() {
createCanvas(1920,1080)
//Stars
for (var i = 0; i < 1000; i++) {
stars[i] = new Star();
}
// Starts in the middle
x = width / 2;
y = height / 2;
//noLoop();
}
// star class //
class Star {
constructor() {
this.x = random(width);
this.y = random(height);
this.size = random(0.25, 3);
this.t = random(TAU);
}
draw() {
this.t += 0.1;
var scale = this.size + sin(this.t) * 2;
fill(255)
noStroke();
ellipse(this.x, this.y, scale, scale);
}
}
function draw() {
background(0, 8, 66);
//stars
for (var i = 0; i < stars.length; i++) {
stars[i].draw();
}
//moon
fill(213, 217, 204)
circle(320,1060,975)
//moonCirle1
fill(155,158,147)
ellipse(320, 650, 200, 100)
//moonCirle2
fill(155,158,147)
ellipse(25, 950, 500, 500)
//moonCirle3
fill(155,158,147)
ellipse(600, 850, 100, 200)
//wheeloutline1
fill('black');
circle(150, 530, 140);
//wheel1
fill('white');
circle(150, 530, 120);
//wheelinside1
fill('black');
circle(150, 530, 20);
//wheeloutline2
fill('black');
circle(500, 530, 140);
//wheel2
fill('white');
circle(500, 530, 120);
//wheelinside2
fill('black');
circle(500, 530, 20)
//car body
fill(133, 131, 131)
rect(30, 385, 600, 75);
//chair1
fill(133, 131, 131)
rect(220,360,15,100)
//chair2
fill(133, 131, 131)
rect(175, 350, 100, 10);
//chair3
fill(133, 131, 131)
rect(175, 250, 10, 100);
//stick
fill(133, 131, 131)
rect(100,200,15,200)
//box
fill(207, 197, 196)
rect(50, 285, 120, 100);
fill('white');
circle(105, 180, 120);
//fire1
fill(215, 53, 2)
triangle(800, 200, -30, -50, -10, 90);
//fire2
fill(255, 117, 0)
triangle(800, 200, -10, -20, -10, 60);
//fire ball
fill(250, 192, 0)
circle(856, 196, 150)
//earth
fill(100, 157, 250)
ellipse(1670,250,450)
}