Sprite Catcher
Experience: 1st year, 3rd quarter
Practice: Creating computational artifacts, Testing and refining computational artifacts, and Communicating about computing
Concept: Algorithms, Control, Modularity, and Variables
Length: 40+
Overview and Purpose
Coders combine their understandings from previous projects to create a sprite catcher game. The purpose of this project is to reinforce understandings of modularity in a new context.
Project Extensions
Suggested extensions
Make a sprite fade in and out (10+ minutes):
5+ minute demonstration
Demonstrate how to rename the “Appear and wait” function by right clicking (or shift clicking) the name and selecting “edit.” Demonstrate each how to make a sprite fade in and out in our newly named function, then give time for everyone to pick their own code to make the game harder.
5+ minute discussion and coding time
Ask coders to discuss and compare with a neighbor which method they would use for their own project and why (they could even choose to not have the sprite fade in and out). Once they have compared and discussed the code, have them implement their chosen algorithm in their own project.
Resources, suggestions, and connections
Standards reinforced:
- 1B-AP-08 Compare and refine multiple algorithms for the same task and determine which is the most appropriate
- 1B-AP-10 Create programs that include sequences, events, loops, and conditionals
- 1B-AP-11 Decompose (break down) problems into smaller, manageable subproblems to facilitate the program development process.
Practices reinforced:
- Communicating about computing
- Creating computational artifacts
- Testing and refining computational artifacts
Concepts reinforced:
- Algorithms
- Control
- Modularity
Video: Make a sprite fade in and out (2:17)
Quick reference guide: Click here
Create a missed click detector (10+ minutes):
5+ minute demonstration
Explain that we can delete our previous code that runs when this sprite clicked. Instead, we are going to check if a player clicked the sprite or missed every time a player clicks. Explain the three sections of code (1 - wait blocks, 2 - if section, 3 - else section) on the fourth slide of the quick reference guide. Point out we call this function with a broadcast message block because it will run forever and the My Blocks would never get to the next block because of the loop.
Encourage coders to add more blocks to make it fancier or keep track of a score (see the next project extension).
5+ minute discussion and coding time
Leave your code on the screen and give coders time to add the code to their project. Encourage peer-to-peer assistance and facilitate 1-on-1 as needed.
Standards reinforced:
- 1B-AP-10 Create programs that include sequences, events, loops, and conditionals
- 1B-AP-11 Decompose (break down) problems into smaller, manageable subproblems to facilitate the program development process.
Practices reinforced:
- Creating computational artifacts
- Testing and refining computational artifacts
Concepts reinforced:
- Algorithms
- Control
- Modularity
Video: Create a missed click detector (3:52)
Quick reference guide: Click here
Suggested questions:
- Why do we need to use the two wait until blocks?
- What happens if these blocks are reversed?
- Why couldn’t we add the “if touching mouse-pointer?” block to our when this sprite clicked block? (because it will always be true, but this code will detect if we click and are not touching the sprite)
Potential unplugged lesson: You could engage in a discussion or lesson on conditionals (if/else statements) by working through one of the unplugged lessons on conditionals; for example, Conditionals with Cards.
Keep score (10+ minutes):
5+ minute demonstration
Demonstrate how to add variables to keep score. Ask coders when the score should change (when the sprite is clicked) and how to do that with the blocks on the screen. Demonstrate by adding the code. Remind coders we need to set the score to 0 when we “reset” or “initialize” our game.
If coders are interested, also demonstrate how to create and check for a high score. Point out that we don’t set our high score to 0 when the game begins, because we want the high score to remain from previous play throughs.
5+ minute discussion and coding time
Leave your code on the screen and give coders time to add the code to their project. Encourage peer-to-peer assistance and facilitate 1-on-1 as needed.
Standards reinforced:
- 1B-AP-09 Create programs that use variables to store and modify data.
- 1B-AP-10 Create programs that include sequences, events, loops, and conditionals
- 1B-AP-11 Decompose (break down) problems into smaller, manageable subproblems to facilitate the program development process.
Practices reinforced:
- Creating computational artifacts
- Testing and refining computational artifacts
Concepts reinforced:
- Algorithms
- Control
- Modularity
- Variables
Video: Keep score (4:38)
Quick reference guide: Click here
Suggested questions:
- What other projects could you add a score to?
- What about a high score?
- When might a player lose a point?
- Can a player win/lose in your game or will it go on forever?
- When might a player lose?
- When might a player when?
- What code would you need to do that?
Make sprites move for an extra challenge (10+ minutes):
5+ minute demonstration
Demonstrate how to create a function that moves sprites around (in addition to making them hide in random locations). If coders are using variables, use the video or quick reference guide to talk through how to make sprites move progressively faster or make sprites move once a certain number has been caught.
5+ minutes to code their project and 1-on-1 facilitating
Leave your code on the screen and give coders time to add the code to their project. Encourage peer-to-peer assistance and facilitate 1-on-1 as needed.
Standards reinforced:
- 1B-AP-09 Create programs that use variables to store and modify data.
- 1B-AP-10 Create programs that include sequences, events, loops, and conditionals
- 1B-AP-11 Decompose (break down) problems into smaller, manageable subproblems to facilitate the program development process.
Practices reinforced:
- Creating computational artifacts
- Testing and refining computational artifacts
Concepts reinforced:
- Algorithms
- Control
- Modularity
- Variables
Video: Make sprites move for an extra challenge (3:54)
Quick reference guide: Click here
Suggested questions:
- What else could you do to make the game even harder for a player?
- How could you use variables to make the game progressively harder?
- What about making it so the game has multiple levels of difficulty?
Create a start button (10+ minutes):
5+ minute demonstration
Review how to create a button labeled “Start.” Demonstrate how to make the button show when the green flag is clicked and hide when the sprite is clicked. Create a new broadcast message block named “Start” and add it to the when this sprite clicked block. Replace all of the other when green flag clicked blocks with a when I receive Start blocks.
If coders are more advanced, demonstrate how the example project uses multiple start buttons to change the theme of the game.
5+ minutes to code their project and 1-on-1 facilitating
Leave your code on the screen and give coders time to add the code to their project. Encourage peer-to-peer assistance and facilitate 1-on-1 as needed.
Standards reinforced:
- 1B-AP-10 Create programs that include sequences, events, loops, and conditionals
- 1B-AP-11 Decompose (break down) problems into smaller, manageable subproblems to facilitate the program development process.
Practices reinforced:
- Creating computational artifacts
- Testing and refining computational artifacts
Concepts reinforced:
- Algorithms
- Control
- Modularity
Video: Create a start button (3:24)
Quick reference guide: Click here
Suggested questions:
- Can you create multiple buttons for different themes?
- What about a single button that toggles between two themes?
- How could you give the player the option to switch between these themes while playing the game?
- How could you make it so the game changes themes when a player reaches the next level?
Use the example project as a guide (as needed)
At some point, coders might get stuck or run out of ideas. Rather than explaining to them how to do something, ask them to open the example project, read the comments inside the various sprites and then look at the code to see if they can figure out how to solve their problem. Although this is a very open-ended approach, this models a common coding practice that helps coders become independent learners.
Standards reinforced:
- 1B-AP-10 Create programs that include sequences, events, loops, and conditionals
- 1B-AP-12 Modify, remix, or incorporate portions of an existing program into one's own work, to develop something new or add more advanced features
Practices reinforced:
- Creating computational artifacts
- Testing and refining computational artifacts
Concepts reinforced:
- Algorithms
- Control
Resource: Example project
Facilitation Suggestion: Some coders may not thrive in inquiry based approaches to learning, so we can encourage them to use the Tutorials to get more ideas for their projects; however, we may need to remind coders the suggestions provided by Scratch are not specific to our projects, so it may create some unwanted results unless the code is modified to match our own intentions.
Add even more (30+ minutes, or at least one class):
If time permits and coders are interested in this project, encourage coders to explore what else they can create in Scratch by trying out new blocks and reviewing previous projects to get ideas for this project. When changes are made, encourage them to alter their comments to reflect the changes (either in the moment or at the end of class).
While facilitating this process, monitor to make sure coders don’t stick with one feature for too long. In particular, coders like to edit their sprites/backgrounds by painting on them or taking photos, or listen to the built-in sounds in Scratch. It may help to set a timer for creation processes outside of using blocks so coders focus their efforts on coding.
Standards reinforced:
- 1B-AP-10 Create programs that include sequences, events, loops, and conditionals
Practices reinforced:
- Creating computational artifacts
- Testing and refining computational artifacts
Concepts reinforced:
- Algorithms
- Control
Facilitation Suggestion: Some coders may not thrive in inquiry based approaches to learning, so we can encourage them to use the Tutorials to get more ideas for their projects; however, we may need to remind coders the suggestions provided by Scratch are not specific to our projects, so it may create some unwanted results unless the code is modified to match our own intentions.
Suggested questions:
- What else can you do with Scratch?
- What do you think the other blocks do?
- Can you make your project do ______?
- What other sprites can you add to your project?
- What have you learned in other projects that you could use in this project?
- Could you make this project a story and a game?
- Could you give the user more sprite themes to select from?
- Could you make it so some sprites give you points for clicking on them and other sprites cause you to lose points for clicking on them?
Similar projects:
Have coders explore the code of other peers in their class, or on a project studio dedicated to this project. Encourage coders to ask questions about each other’s code. When changes are made, encourage coders to alter their comments to reflect the changes (either in the moment or at the end of class).
Watch this video (3:20) if you are unsure how to use a project studio.
Standards reinforced:
- 1B-AP-10 Create programs that include sequences, events, loops, and conditionals
- 1B-AP-12 Modify, remix, or incorporate portions of an existing program into one's own work, to develop something new or add more advanced features
Practices reinforced:
- Testing and refining computational artifacts
Concepts reinforced:
- Algorithms
Note: Coders may need a gentle reminder we are looking at other projects to get ideas for our own project, not to simply play around. For example, “look for five minutes,” “look at no more than five other projects,” “find three projects that each do one thing you would like to add to your project,” or “find X number of projects that are similar to the project we are creating.”
Generic questions:
- What are some ways you can expand this project beyond what it can already do?
- How is this project similar (or different) to something you worked on today?
- What blocks did they use that you didn’t use?
- What do you think those blocks do?
- What’s something you like about their project that you could add to your project?
micro:bit extensions:
Note: the micro:bit requires installation of Scratch Link and a HEX file before it will work with a computer. Watch this video (2:22) and use this guide to learn how to get started with a micro:bit before encouraging coders to use the micro:bit blocks.
Much like the generic Scratch Tips folder linked in each Coder Resources document, the micro:bit Tips folder contains video and visual walkthroughs for project extensions applicable to a wide range of projects. Although not required, the micro:bit Tips folder uses numbers to indicate a suggested order for learning about using a micro:bit in Scratch; however, coders who are comfortable with experimentation can skip around to topics relevant to their project.
Standards reinforced:
- 1B-AP-09 Create programs that use variables to store and modify data
- 1B-AP-10 Create programs that include sequences, events, loops, and conditionals
- 1B-AP-11 Decompose (break down) problems into smaller, manageable subproblems to facilitate the program development process
- 1B-AP-15 Test and debug (identify and fix errors) a program or algorithm to ensure it runs as intended
Practices reinforced:
- Recognizing and defining computational problems
- Creating computational artifacts
- Developing and using abstractions
- Fostering an inclusive computing culture
- Testing and refining computational artifacts
Concepts reinforced:
- Algorithms
- Control
- Modularity
- Program Development
- Variables
Folder with all micro:bit quick reference guides: Click here
Additional Resources:
- Printable micro:bit cards
- Micro:bit’s Scratch account with example projects
Generic questions:
- How can you use a micro:bit to add news forms of user interaction?
- What do the different micro:bit event blocks do and how could you use them in a project?
- How could you use the LED display for your project?
- What do the tilt blocks do and how could you use them in your project?
- How could you use the buttons to add user/player controls?
- How might you use a micro:bit to make your project more accessible?
Differentiation
Less experienced coders
Demonstrate the example remix project or your own version, and walk through how to experiment changing various parameters or blocks to see what they do. Give some time for them to change the blocks around. When it appears a coder might need some guidance or has completed an idea, encourage them to add more to the project or begin following the steps for creating the project on their own (or with BootUp resources). Continue to facilitate one-on-one using questioning techniques to encourage tinkering and trying new combinations of code.
If you are working with other coders and want to get less experienced coders started with remixing, have those who are interested in remixing a project watch this video (2:42) to learn how to remix a project.
More experienced coders
Demonstrate the project without showing the code used to create the project. Challenge coders to figure out how to recreate a similar project without looking at the code of the original project. If coders get stuck reverse engineering, use guiding questions to encourage them to uncover various pieces of the project. Alternatively, if you are unable to work with someone one-on-one at a time of need, they can access the quick reference guides and video walkthroughs above to learn how each part of this project works.
If you are working with other coders and want to get more experienced coders started with reverse engineering, have those who are interested watch this video (2:30) to learn how to reverse engineer a project.
Debugging Exercises (1-5+ minutes each)
Debugging exercises
Why does it only check we if clicked on the sprite on our first click?
- We need to put this code inside a loop so it checks more than once.
- Note: If we put it inside a “repeat” instead of “forever,” this will limit how many times we can try and catch a sprite to the number of repeats.
Why don't both buttons hide when the game starts?
micro:bit required Why don't we score or lose a point when we swing the net to the left?
Resources and suggestions
Standards reinforced:
- 1B-AP-15 Test and debug (identify and fix errors) a program or algorithm to ensure it runs as intended
Practices reinforced:
- Testing and refining computational artifacts
Concepts reinforced:
- Algorithms
- Control
Suggested guiding questions:
- What should have happened but didn’t?
- Which sprite(s) do you think the problem is located in?
- What code is working and what code has the bug?
- Can you walk me through the algorithm (steps) and point out where it’s not working?
- Are there any blocks missing or out of place?
- How would you code this if you were coding this algorithm from Scratch?
- Another approach would be to read the question out loud and give hints as to what types of blocks (e.g., motion, looks, event, etc.) might be missing.
Reflective questions when solved:
- What was wrong with this code and how did you fix it?
- Is there another way to fix this bug using different code or tools?
- If this is not the first time they’ve coded: How was this exercise similar or different from other times you’ve debugged code in your own projects or in other exercises?
Unplugged Lessons and Resources
Although each project lesson includes suggestions for the amount of class time to spend on a project, BootUp encourages coding facilitators to supplement our project lessons with resources created by others. In particular, reinforcing a variety of standards, practices, and concepts through the use of unplugged lessons. Unplugged lessons are coding lessons that teach core computational concepts without computers or tablets. You could start a lesson with a short, unplugged lesson relevant to a project, or use unplugged lessons when coders appear to be struggling with a concept or practice.
List of 100+ unplugged lessons and resources
Incorporating unplugged lessons in the middle of a multi-day project situates understandings within an actual project; however, unplugged lessons can occur before or after projects with the same concepts. An example for incorporating unplugged lessons:
Lesson 1. Getting started sequence and beginning project work
Lesson 2. Continuing project work
Lesson 3. Debugging exercises and unplugged lesson that reinforces concepts from a project
Lesson 4. Project extensions and sharing
Reflection and Sharing
Reflection suggestions
Coders can either discuss some of the following prompts with a neighbor, in a small group, as a class, or respond in a physical or digital journal. If reflecting in smaller groups or individually, walk around and ask questions to encourage deeper responses and assess for understanding. Here is a sample of a digital journal designed for Scratch (source) and here is an example of a printable journal useful for younger coders.
Sample reflection questions or journal prompts:
- How did you use computational thinking when creating your project?
- What’s something we learned while working on this project today?
- What are you proud of in your project?
- How did you work through a bug or difficult challenge today?
- What other projects could we do using the same concepts/blocks we used today?
- What’s something you had to debug today, and what strategy did you use to debug the error?
- What mistakes did you make and how did you learn from those mistakes?
- How did you help other coders with their projects?
- What did you learn from other coders today?
- What questions do you have about coding?
- What was challenging today?
- Why are comments helpful in our projects?
- How is this project similar to other projects you’ve worked on?
- How is it different?
- What other games could you create based off what you learned in this project?
- What other themes could you create for this project?
- How would you change your code to match the other themes?
- How could you turn this project into an interactive story?
- More sample prompts
Sharing suggestions
Standards reinforced:
- 1B-AP-17 Describe choices made during program development using code comments, presentations, and demonstrations
Practices reinforced:
- Communicating about computing
- Fostering an inclusive culture
Concepts reinforced:
- Algorithms
- Control
- Modularity
- Program development
Peer sharing and learning video: Click here (1:33)
At the end of class, coders can share with each other something they learned today. Encourage coders to ask questions about each other’s code or share their journals with each other. When sharing code, encourage coders to discuss something they like about their code as well as a suggestion for something else they might add.
Publicly sharing Scratch projects: If coders would like to publicly share their Scratch projects, they can follow these steps:
- Video: Share your project (2:22)
- Video (Advanced): Create a thumbnail (4:17)