Lesson: Broadcasting Messages
Time: 60+ mins
IntroductionIn this lesson, students will learn how to send and receive messages between Actors in a program. Note: Some modules in this lesson include a listening component, so headphones (1 per student) are recommended.
: Listen for a message or broadcast from other scripts before activating. : Broadcast a message to the program. : Play the specified kind of drum for the specified number of beats. : Pause the program for a specific number of seconds. : Change the costume of the Actor.
- Use code block to program Actors to send and receive messages
- Computers, laptops, or mobile devices (1 per student) with student account access to Tynker.com
- Headphones (1 per student)
Warm-Up (15 minutes)
- As a class, review vocabulary terms. Ask students, "Can anyone tell me what _____ means?" Here is a list of recommended vocabulary terms to review: coding, sequence, Actors, infinite loop, repeating loop, animation.
Activities (45 minutes)Facilitate as students complete all Broadcasting Messages modules on their own:
1. Introduction (Video)
- This module introduces three coding concepts:
- Send Message To- The "sent message to" code block sends a message to the specified Actor.
- Broadcast- The "broadcast" code block sends a message to all of the Actors in a project.
- When I Receive- The "when I receive" code attached to this event block will run when it receives a message from a "send message to" or "broadcast" block.
- This module is an example of a musical project, where each button will send a message to the BeatBot and make it dance!
- In this DIY (do-it-yourself) project, students will follow step-by-step directions to program the button Actors to control the BeatBot!
- Emphasize to students that the "broadcast" block is used to send messages from the button Actors to the BeatBot. Note that the BeatBot is already coded to respond to each message by performing a dance move.
- Optional: Ask students, "Why did we add the ‘next costume’ and ‘wait’ blocks beneath the ‘broadcast’ blocks?" (To animate the buttons so they look like they’re actually being pressed)
- Did students finish early? Direct their attention to the bonus section in the last step of the tutorial, which encourages students to adjust the dance speed by modifying the BeatBot’s code.
- To solve this puzzle module, students will need to program the buttons to send messages to the BeatBot. Additionally, students will need to program the BeatBot to play a drum sound when it receives each message.
- As students are testing their program, check that they are pressing the button Actors the moment the falling orbs are lined up with them. 4 points wins the game!
- Now that your students know how to send messages, they will view a project where the BeatBot plays music when it receives messages!
- In this DIY project, students will add background music and program two buttons to make the BeatBot play sounds.
- Ask your students to play the sounds using the buttons. Can they make a beat to go along with the background music?
- Did students finish early? Encourage them to experiment with their code to make the BeatBot move when it plays a sound!
- Students will answer 5 multiple choice questions to review concepts covered in this lesson.
Extended Activities (10 minutes)Discuss the following with students:
- Who can remember one example where we programmed Actors to respond to one another through broadcasting and receiving messages? (programed buttons to make the BeatBot play sounds)
- How else can we use broadcasting and receiving messages in a scene? (e.g., create a race game in which an Actor is programmed to say "On your mark. Get set. Go!" and the other Actors respond by starting to move across the screen.
- True or false: The "broadcast" code block sends a message to all of the Actors in a project. (True)
- CCSS-Math: MP.1
- CCSS-ELA: RF.1.1, RF.2.4, RF.2.4.A, RF.3.4.A, RF.4.4.A, RI.2.6
- CSTA: 1B-AP-10, 1B-AP-11, 1B-AP-15
- CS CA: 3-5.AP.12, 3-5.AP.13, 3-5.AP.17
- ISTE: 1.c, 1.d, 4.d, 5.c, 5.d, 6.b
These student-facing slide presentations help educators seamlessly run Tynker lessons in a virtual or physical classroom setting. Each lesson has its own set of slides that introduce the big ideas, suggest unplugged activities, and include a section for each activity module. While running lesson slides, you can switch back and forth between the activity, the slides, answer keys and other lesson materials.
A sample slide presentation is available for your review. Please log in to view all the class presentations available with your plan..
Loops and Animation
Creating a Scene
Jumping over Obstacles
Music and Animation
Instruments and Tempo
Message Driven Programming
Pop the Balloon
Animation with Movement