Programming 301 Lesson Plan
Lesson: Nested Loops
Time: 60+ mins
IntroductionIn this lesson, students will learn how to use nested loops, program Actors to have multiple lives, and create a game with a boss fight! Coding concepts from this lesson include: Wait Until and Nested Loops.
New Code Blocks
: Pauses the current script until the parameter condition is true.
- Nested loop: A structure where one loop contains one or more loops
- Use nested loops to program Actors to have multiple lives
- Use code blocks to solve a puzzle module
- Create a game with a boss battle
- Computers, laptops, or mobile devices (1 per student) with student account access to Tynker.com
Warm-Up (15 minutes)Number of Lives and Boss Fights
- Ask students to share an example of a game where the character takes damage until it loses a life. How does the game indicate life status? With hearts? A health meter?
- Some students may not be familiar with the idea of a boss fight. Ask a student to describe the term. Then explain that bosses are enemies in video or computer games that are more intimidating and powerful than regular enemies. Optional: Ask your students to give examples of boss fights in video or computer games (e.g., Bowser in Super Mario© games).
Activities (45 minutes)Facilitate as students complete all Nested Loops modules on their own:
1. Concepts (Video)
- Bert, the wizard, introduces two coding concepts:
- Wait Until- Students will watch an interactive example that uses the “wait until” block.
- Nested Loops- Students will learn about nested loops and see an example of a nested loop that animates Rufus, the dancing zombie.
- In this DIY (do-it-yourself) project, students will follow step-by-step directions to program a zombie to withstand two fireball blasts before disappearing on the third blast.
- The fireball goes wherever students click (web) or tap (mobile) on their screen. Click (web) or tap (mobile) the zombie to hit it.
- Point out to students that the enemy requires multiple hits to be defeated, similar to a boss in a video or computer game.
- In this DIY project, students will expand on their previous game by programming the zombie to appear in a random location on the Stage after it is defeated. Students will also program a victory sound to play after the zombie is defeated twice.
- Did students finish early? Ask them to add more lives by changing the value in the “repeat” loops.
- To solve this puzzle module, students will need to program the knight so he has enough lives to collect all the treasure.
- Students will need to set the “repeat” block to a value of 4 or higher.
- In this DIY project, students will create a boss battle where the hero and the boss have multiple lives.
- Did students finish early? “Step 4” of the tutorial provides suggestions on how your students can improve their game.
- Students will answer multiple-choice questions to review concepts from this lesson.
Extended Activities (10 minutes)Discussion
- Ask students to think of an idea for a game, other than a battle scene, where they might need an Actor to have multiple lives. Next, have them discuss their ideas with a partner.
- Here are some examples:
- You can create a game where a fisherman Actor catches different colored fish, but loses a life every time he/she catches a red fish.
- You can create a skateboard game where a person loses a life each time he/she falls off their board as a result of colliding with an obstacle or not landing a trick.
- CCSS-Math: MP.1, MP.2, MP.4, 6.NS.C.6
- CCSS-ELA: RI.7.4, RI.8.4, 6-8.RST.3, 6-8.RST.4, 6-8.RST.7
- CSTA: 2-AP-10, 2-AP-13, 2-AP-16, 2-AP-18
- CS CA: 6-8.AP.10, 6-8.AP.13, 6-8.AP.17
- ISTE: 1.c, 1.d, 4.d, 5.c, 5.d, 6.b
U.k. StandardsKey Stage 3 (Years 7-9)
- Understand several key algorithms that reflect computational thinking [for example, ones for sorting and searching]; use logical reasoning to compare the utility of alternative algorithms for the same problem.
- Create, re-use, revise and re-purpose digital artefacts for a given audience, with attention to trustworthiness, design and usability.
- Understand a range of ways to use technology safely, respectfully, responsibly and securely, including protecting their online identity and privacy; recognise inappropriate content, contact and conduct and know how to report concerns.
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..
Motion and Tracking
Show and Hide
Start Screen and Controls
Powerups and Effects