In this lesson, we learned how to draw using code. I made a christmas tree on a blanket of snow, because it's almost christmas and it felt appropriate. Over the past week, we learned how to draw shapes such as triangles, rectangles, ellipses and even custom shapes with javascript, a type of coding "language". we also learned how to seperate lines of code using a semicolon, and how to input points of a shape using code. This could have practical use in real life, whenever we need to code, as this lesson taught us all about learning to code. If I ever do need to code in the future, I can always think back to this lesson. Click here to try out the KhanAcademy tutorials yourself! background(171, 171, 171);
//base fill(138, 143, 107); rect(160,200,80,100); //leaves fill(28, 150, 0); triangle(90, 250, 200, 70, 310, 250); triangle(100, 200, 200, 50, 300, 200); triangle(110, 150, 200, 30, 290, 150); triangle(120, 100, 200, 10, 280, 100); //ornaments fill(255, 0, 0); ellipse(120, 100, 20, 20); ellipse(280, 100, 20, 20); ellipse(110, 150, 20, 20); ellipse(290, 150, 20, 20); ellipse(100, 200, 20, 20); ellipse(300, 200, 20, 20); ellipse(90, 250, 20, 20); ellipse(310, 250, 20, 20); ellipse(200, 15, 20, 20); ellipse(200, 100, 20, 20); ellipse(200, 150, 20, 20); ellipse(200, 200, 20, 20); ellipse(240, 100, 20, 20); ellipse(160, 100, 20, 20); ellipse(200, 60, 20, 20); ellipse(150, 60, 20, 20); ellipse(250, 60, 20, 20); ellipse(150, 150, 20, 20); ellipse(250, 150, 20, 20); ellipse(140, 200, 20, 20); ellipse(260, 200, 20, 20); ellipse(270, 250, 20, 20); ellipse(130, 250, 20, 20); ellipse(170, 250, 20, 20); ellipse(230, 250, 20, 20); //ground fill(255, 255, 255); rect(0, 350, 400, 100);
0 Comments
|
Archives
June 2023
Categories |