1.8 Virtual Pet

Students will utilize a Scratch tutorial to further their understanding of broadcast and receive while learning about other blocks.

OBJECTIVES



OBJECTIVES: By the end of this lesson, students will:

    • create a project using broadcast and receive blocks to trigger a sprite to interact with different objects on the stage.

    • explore other Scratch blocks (such as repeat loops and variables) they will learn about in future units.

TEACHER RESOURCES:

Standards

    • CSTA 2-AP-17: Systematically test and refine programs using a range of test cases.

CSTA

Do Now (5 minutes)

Careers in Tech

Students watch the video Made with Code: Limor Fried (1.41) then discuss:

    • Do you agree with Limor, that coding is more fun when making things?

    • What example of did Limor show, of making something unique?

    • What would you like to build with code?

TEACHER GUIDANCE: Limor showed a prom dress with lights.

Mini-Lesson (5-10 minutes)

Demonstrate a finished version of the Create a Virtual Pet project, leading students to understand how a sprite interacts with other sprites when those sprites are clicked.

  • Review with students which sprite’s program should contain the broadcast block, and which sprite’s program should contain the receive block.

  • Show students how to navigate to the Tips toolbar on the right side of the screen in Scratch so they can begin working on their project.

Project (20-30 minutes)


Students use tutorial Cards and their imagination to create a virtual pet.

The virtual pet will include a variety of messages being broadcast. Students will use code to make their pet behave differently depending on the message that it receives.

Close-Out (5 minutes)

Discuss the following questions:

  • If you wanted your pet to eat an apple when the apple sprite is clicked, which sprite would use the broadcast block and which sprite would use the receive block?

  • What other things could you add to your project? How would your pet interact with them?

  • What challenges did you encounter today? How did you overcome those challenges?

Potential Responses

The apple sprite would broadcast a message when clicked. When the pet sprite received that message, it to move towards the apple and eat it.