Lesson 4: Shapes and Randomization

Game Lab


In this lesson students continue to develop their familiarity with Game Lab by manipulating the width and height of the shapes they use to draw. The lesson kicks off with a discussion that connects expanded block functionality (e.g. different sized shapes) with the need for more block inputs, or “parameters”. Students learn to draw with versions of ellipse() and rect() that include width and height parameters. They also learn to use the background() block. At the end of the progression students are introduced to the randomNumber() block. Combining all of these skills students will draw a randomized rainbow snake at the end of the lesson.


Students will be able to:

  • Use and reason about drawing commands with multiple parameters
  • Generate and use random numbers in a program


  • Parameter – An extra piece of information passed to a function to customize it for a specific need

Introduced Code

Warm Up (5 min)

  1. ellipse()
  2. randomNumber(5, 10)
  3. rect

Shapes of Different Sizes

Prompt: Our ellipse and rect blocks each have two inputs that control where they’re drawn – the x and y position. If you wanted these commands to draw a wider variety of rectangles and ellipses, what additional inputs might you need to give these blocks? What would each additional input control?

If we want our blocks to draw shapes in different ways they’ll need more inputs that let us tell them how to draw. The inputs or openings in our blocks have a formal name, parameters, and today we’re going to be learning more about how to use them.

Activity (40 min)

Programming Images

Transition: Go to Code Studio

Wrap Up (5 min)

Journal: Reflect on your development of the five practices of CS Discoveries (Problem Solving, Persistence, Creativity, Collaboration, Communication). Choose one of the following prompts to respond to:

  • Choose one of the five practices in which you believe you demonstrated growth in this lesson. Write something you did that exemplified this practice.
  • Choose one practice you think you can continue to grow in. What’s one thing you’d like to do better?
  • Choose one practice you thought was especially important for the activity we completed today. What made it so important?


Leave a Reply

Your email address will not be published. Required fields are marked *