Please enable JavaScript to use CodeHS

Indiana Computer Science: 8th Grade

Lesson 3.1 Getting Started

Description

In this lesson, students learn how to create a canvas inside of the setup() function and learn its coordinate system. Students will also learn how to draw basic shapes in the draw() function loop.


Objective

Students will be able to:

  • Bridge connections between computation and creative expression
  • Explore the p5.js reference guide and example projects
  • Understand the HTML5 canvas and coordinate system
  • Differentiate the function of setup() and draw()
  • Set the size of the canvas: createCanvas()
  • Use p5 shape-drawing functions for primitive shapes (ellipse, rect, line)
  • Call and pass parameters to functions