Overview
https://www.loom.com/share/414fe40ceab5469398de1a046329ce4b?sid=c7226ffd-81c7-41ba-92fb-48b4fa5d98c0
Pre-Lesson Notes
- Explore the example project to make sure you understand how it works
- Share a link to the starter project on your LMS
Lesson Flow
- Do Now (2-3 min): How can we use conditional blocks and sensor blocks to make our sprites interact?
- Lecture/Discussion (5-7 min)
- Review conditionals
- Scratch makes code like we do, based on conditions
- When a condition block is true, the code inside will run
- Treasure Hunt Project!
- We’ll use conditionals to make a treasure hunt in Scratch
- Show students how the project works (show the GIF on the slide or open the example project for a live demo)
- Scratchy needs a key to open the treasure chest!
- The key is hidden behind one of the other sprites in the scene
- If Scratchy touches one of the sprites it
- Says it doesn’t have the key
- Or, if it is the sprite with the key, the key is revealed!
- When Scratchy touches the key, the key sprite disappears and Scratchy switches to a costume holding the key
- If Scratchy touches the treasure chest while holding the key, it opens!
- Review the Do Now questions — how might the interactions from the example project work?
- What sprite interactions will we need to code?
- Scratchy touching the chest, extra sprites, and key
- Walk students through the different components we’ll need to code!
- Ask them to describe what they see happening in the GIF
- Show the code blocks that make that interaction possible
- Nested If Statements
- For the treasure chest, we’ll need some nested If statements (these are already set up in the starter project — students will just need to add the input and output blocks)
- If Scratchy touches the chest
- And IF Scratchy doesn’t have the key, a “need key” message gets broadcast
- And IF Scratchy does have the key, an “open” message gets broadcast
- The treasure chest receives the messages and displays the corresponding output/costume
- Activity (15-20 min)
- Students will follow the steps on the activity guide to build their treasure hunt program!
- They can customize as much as they feel comfortable
- Students may benefit from a second class period to work on their projects
- Wrap up/Clean up (2-3 min)
Slides
https://docs.google.com/presentation/d/1Z8v38Be2ipAnZiR4w6-C7zqoGS-YkV9AdiDGLWBzS3A/edit?usp=sharing
Activity Guide
https://docs.google.com/document/d/1QkGQkhubog0SjSng15SojRMbVC0xn1V1VSqPjZWikOw/edit?usp=sharing
Scratch Projects