Project Description
Background
Did you know that people were carving out vegetables, like turnips and potatoes, as a Halloween tradition as early as the 1800’s? It is thought that this tradition likely originated in Ireland, where these carved lanterns were to portray supernatural beings or to ward off evil spirits. There’s an old Irish folktale that tells of a blacksmith called Stingy Jack, who, after tricking the Devil, is forced to wander the night upon his death, with only a burning coal as his light. He became known as Jack of the Lantern… sound familiar? Here’s what a traditional Irish jack o’lantern may have looked like, as carved into turnips:
Quite frightening, no? When the tradition crossed the Atlantic to North America, people began carving faces into pumpkins instead, which were not native to Ireland, but common in America.
Your Task
In this project, you are going to create your own jack o’lantern by wielding the power of the JavaScript programming language! The requirements are simple: your creation must be a digital representation of a jack o’lantern and include at least three different types of JavaScript graphics. You are welcome to add other elements to your scene as well, like a background or other props. Go wild!
In addition to the Rectangle, Circle, and Line graphics that you’ve likely learned in class, there are two other graphics that may be helpful to include in your arsenal:
The Oval
The oval is similar to a circle, but instead of sending in a radius as a parameter, you send a width and height, like:
let oval = new Oval(100, 50);
add(oval);
The Polygon
You can create a polygon, which is a closed 2D shape comprised of straight-line segments, by adding a series of points that represent the vertices of the shape. It’s like you’re connecting the points in the order that you add them. For example:
let poly = new Polygon();
poly.addPoint(20, 30);
poly.addPoint(40, 15);
poly.addPoint(80, 30);
poly.addPoint(30, 60);
add(poly);
Sources: