1.7 Dance Party

Students will create a Scratch dance party, using the broadcast and receive command blocks to trigger the party to start!

OBJECTIVES


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

    • Broadcast is an Event Block.

    • Broadcast can trigger multiple sprites

    • Receive block is waiting for one particular broadcast message and will not react when other messages are broadcast.

TEACHER RESOURCES:

Standards

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

CSTA

Do Now (5 minutes)

Play the Broadcast and Receive game with your students! You can also make your own game using index cards.

Take-Aways:

    • One broadcast can trigger multiple sprites, in this case students.

    • Receive blocks only response when their unique message is broadcast. They do not respond to other broadcast messages.

Mini-Lesson (5-10 minutes)

Ask students to think back to Events they have used in scratch? Events trigger action and start code. Here are some examples.

Today students are going to use a new Event called broadcast.

Just like the DoNow game :

    • One broadcast can trigger multiple sprites.

    • Receive blocks only response when their unique message is broadcast. They do not respond to other broadcast messages.


PROJECT (20-30 minutes)


Demo final Project of an example project that students will create.

  • Create a new project with two sprites.

  • Drag a broadcast command into the scripts area and show students how to create a new message name for a broadcast.

  • Broadcast from one sprite. Have the second sprite receive it.

It is helpful to show students how to drag a chunk of code from one sprite into another.

Go over checklist section on student handout or student page. Get students started in teams of two. Pair Programming.

Close-Out (5 minutes)

Discuss the following questions:

    • How did you make all 4 sprites dance when only one sprite was clicked?

    • Why is Broadcast useful?

    • How can the sprite dance and play music at the same time?

Potential Responses

  • The broadcast command sends a message to all sprites. Sprites waiting to receive that unique Broadcast message will then react.

  • Broadcast allows sprite to interact and send each other tiggers. It can be used as sprites can react together to a change eg. new level in a game.

  • Two scripts can work in parallel, one playing music the other doing controlling the dancing moves