NaN:NaN
NaN:NaN
--:-- / --:--
Newgrounds Background Image Theme

Timeslayer13 just joined the crew!

We need you on the team, too.

Support Newgrounds and get tons of perks for just $2.99!

Create a Free Account and then..

Become a Supporter!

JavaScript Snowman

Share

This is a snowman illustration I made in JavaScript on Khan Academy for an assignment in my robotics class. It's all made with a keyboard and nothing else. I was gonna put more detail in it, but it already took me several hours, so I took a pass on that... this is a first for me.


JavaScript Code:


background(0, 200, 255);


// sun

noStroke();

fill(255, 255, 225);

quad(375, 47, 500, 400, -200, 350, 334, 30);

fill(255, 255, 0);

ellipse(350, 50, 50, 50);

fill(255, 225, 0);

ellipse(351, 47, 45, 45);


// ground

stroke(0, 0, 0);

fill(255, 255, 255);

ellipse(200, 400, 1000, 200);


// tree

noStroke();

fill(105, 65, 0);

rect(300, 260, 20, 80);


fill(70, 43, 0);

rect(300, 260, 16, 80);


noFill();

stroke(0, 0, 0);

rect(300, 260, 20, 80);


fill(255, 255, 255);

bezier(270, 340, 300, 320, 320, 320, 346, 350);

stroke(200, 200, 200);

fill(200, 200, 200);

bezier(270, 345, 305, 320, 320, 330, 341, 352);

bezier(270, 345, 240, 420, 330, 420, 341, 352);

strokeWeight(2);

line(272, 345, 339, 352);


noStroke();

fill(67, 156, 67);

triangle(310, 130, 410, 280, 210, 280);


fill(45, 104, 45);

triangle(310, 130, 385, 280, 210, 280);


noFill();

stroke(0, 0, 0);

strokeWeight(1);

triangle(310, 130, 410, 280, 210, 280);


noStroke();

fill(67, 156, 67);

triangle(310, 85, 380, 185, 240, 185);


fill(45, 104, 45);

triangle(310, 85, 370, 185, 240, 185);


noFill();

stroke(0, 0, 0);

triangle(310, 85, 380, 185, 240, 185);


fill(67, 156, 67);

noStroke();

triangle(310, 60, 350, 115, 270, 115);


fill(45, 104, 45);

triangle(310, 60, 343, 115, 270, 115);


noFill();

stroke(0, 0, 0);

triangle(310, 60, 350, 115, 270, 115);


fill(255, 225, 0);

quad(313, 50, 320, 70, 300, 70, 307, 50);


fill(255, 255, 0);

beginShape();

vertex(310, 30);

vertex(318, 44);

vertex(334, 45);

vertex(322, 54);

vertex(325, 66);

vertex(310, 56);

vertex(295, 66);

vertex(298, 54);

vertex(286, 45);

vertex(302, 44);

vertex(310, 30);

endShape();


// christmas lights

noFill();

bezier(237, 240, 300, 250, 260, 280, 396, 260);

bezier(264, 200, 300, 200, 330, 250, 363, 210);

arc(340, 163, 83, 70, 40, 70);

bezier(265, 150, 280, 190, 330, 200, 373, 175);

bezier(282, 100, 290, 130, 330, 150, 341, 130);

bezier(310, 70, 310, 80, 330, 100, 325, 80);


fill(255, 0, 0);

ellipse(300, 280, 13, 20);

line(300, 270, 300, 265);


fill(117, 117, 255);

ellipse(250, 257, 13, 20);

line(250, 247, 250, 243);


fill(0, 234, 255);

ellipse(280, 190, 13, 20);

line(280, 172, 280, 180);


fill(255, 255, 0);

ellipse(335, 150, 13, 20);

line(335, 135, 335, 140);


// snowman shadow

noStroke();

fill(200, 200, 200);

quad(75, 350, 142, 360, 130, 401, -100, 401);


// snowman body

fill(255, 255, 255);

noStroke();

ellipse(100, 300, 150, 150);


fill(200, 200, 200);

ellipse(96, 303, 140, 140);


noFill();

stroke(0, 0, 0);

ellipse(100, 300, 150, 150);


fill(255, 255, 255);

noStroke();

ellipse(100, 200, 100, 100);


fill(200, 200, 200);

ellipse(97, 202, 94, 94);


noFill();

stroke(0, 0, 0);

ellipse(100, 200, 100, 100);


fill(255, 255, 255);

noStroke();

ellipse(100, 120, 75, 75);


fill(200, 200, 200);

ellipse(98, 122, 70, 70);


noFill();

stroke(0, 0, 0);

ellipse(100, 120, 75, 75);


// snowman eyes

fill(0, 0, 0);

ellipse(89, 115, 10, 10);

ellipse(111, 115, 10, 10);


// snowman mouth

noFill();

arc(100, 130, 30, 30, 30, 150);


// snowman nose

fill(170, 100, 0);

bezier(100, 130, 65, 110, 135, 110, 100, 130);


// snowman arms

strokeWeight(5);

line(20, 120, 70, 180);

line(20, 120, 2, 115);

line(20, 120, 8, 106);

line(20, 120, 20, 100);


line(170, 220, 130, 180);

line(170, 220, 150, 250);

line(150, 250, 130, 252);

line(150, 250, 137, 260);

line(150, 250, 149, 264);

Log in / sign up to vote & review!

Credits & Info

Views
100
Score
Waiting for 3 more votes

Uploaded
Dec 14, 2020
5:24 PM EST
Category
Illustration

You might also enjoy...

Licensing Terms

You may not use this work for any purposes.