Programming 301 Lesson Plan

Lesson: Nested Loops
Time: 60+ mins

Introduction

In 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.

Vocabulary

  • Nested loop: A structure where one loop contains one or more loops

Objectives

Students will...
  • 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

Materials

  • 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.
2. Multiple Lives 1 (DIY)
  • 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.
3. Multiple Lives 2 (DIY)
  • 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.
4. Let There Be Lives (Puzzle)
  • 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.
5. Boss Battle (DIY)
  • 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.
6. Quiz (Multiple-choice)
  • 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.

U.S. Standards

  • 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. Standards

Key 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.
This course is not part of your plan. Please upgrade to view all answer keys

Class Presentations

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..
Lesson 1
Introduction
27 Slides
Lesson 2
Animated Motion
20 Slides
Lesson 3
Actor Positioning
19 Slides
Lesson 4
Motion and Tracking
18 Slides
Lesson 5
Conditional Loops
23 Slides
Lesson 6
Show and Hide
20 Slides
Lesson 7
Actor Properties
18 Slides
Lesson 8
Nested Loops
18 Slides
Lesson 9
Messaging
21 Slides
Lesson 10
Start Screen and Controls
21 Slides
Lesson 11
Shoot Projectiles
21 Slides
Lesson 12
Parallax Scrolling
18 Slides
Lesson 13
Cloning
19 Slides
Lesson 14
Variables
20 Slides
Lesson 15
Powerups and Effects
20 Slides
Lesson 16
Boss Battle
18 Slides
Lesson 17
Finishing Touch
15 Slides