Lesson Plan

Lesson: Motion and Tracking
Time: 60+ mins

Introduction

Now it's time to learn how to program keyboard keys (web) or tilt controls (mobile) to move Actors in different directions! Activities include navigating a knight, animating a knight to attack, and creating a fun maze game. In the maze game DIY (do-it-yourself) activity, students will learn how to program Actors to detect when they’re touching another Actor or the edge of the screen. Coding concepts covered in this lesson include: Point in Direction, When Key Pressed, and Touching?. What unique maze games will your students create?

Code Blocks

  • : Keep repeating the blocks inside this loop forever.
  • : Repeat blocks inside this loop a specified number of times.
  • : If the condition is true, then run the code inside the block.
  • : Change the Actor's costume to the specified one.
  • : Return true if the Actor is touching the specified parameter. Otherwise, return false.
  • : Return true if the user is pressing the specified key. Otherwise, return false.

Vocabulary

  • Condition: A logical expression that evaluates to true or false
  • Conditional statement: A type of statement that executes different parts of the code based on whether a logical expression evaluates to true or false

Objectives

Students will...
  • Use code blocks to program Actors to move in specific directions
  • Use code blocks to solve a puzzle module
  • Create a maze game

Materials

  • Computers, laptops, or mobile devices (1 per student) with student account access to Tynker.com

Warm-Up (15 minutes)

Prepare students for today's Maze Level module by asking them to sketch a maze design. Who can design the most challenging maze? Next, pair up students and ask them to discuss the following:
  • If you created a maze game, what theme would you choose?
  • Which characters would you choose? Is there treasure at the end of the maze? Is there a time limit?
  • What code blocks would you use?

Activities (45 minutes)

Facilitate as students complete all Motion and Tracking modules on their own:
1. Concepts (Video)
  • Bert, the wizard, introduces three coding concepts:
    • Point in Direction- Students will interact with “point in direction” code blocks and observe how they affect Codey.
    • When Key Pressed- Students will interact with “when key pressed” code blocks and observe how they affect Codey.
    • Touching?- Students will learn about the “touching?” condition by watching a short animation of the wizard interacting with Codey.
2. The Knight Moves (DIY)
  • In this DIY (do-it-yourself) project, students will follow step-by-step directions to program a knight to move around using the arrow keys (web) or tilt controls (mobile).
  • Check that students are programming the knight to move up, right, down, and left.
3. The Knight Attacks (DIY)
  • In this DIY project, students will need to program the knight so that he is unable to walk through the castle walls.
  • Optional: Ask students to think about how walls might be useful in games. For example, walls can be used as barriers, like in a maze game.
4. Castle Maze (Puzzle)
  • To solve this puzzle module, students will need to program the valkyrie to navigate the castle maze. Can they reach the treasure without getting caught by ghosts?
  • Give a hint: Ask students, “When the ‘up arrow’ is pressed, what should the ‘point in direction’ block be set to?” (Answer: 0 degrees)
5. Maze Level (DIY)
  • In this DIY project, students will create a maze for their knight. The project starts off blank, so students will need to add their own background, Actors, and code.
  • Are students struggling to locate the code blocks? Tell them to select the “Blocks” tab that’s located to the right of the “Tutorial” tab.
  • Optional- Remind students to check out the Tynker support videos if they get stuck: https://www.tynker.com/support/videos.
6. Quiz (Multiple-choice)
  • Students will answer multiple-choice questions to review concepts from this lesson.

Extended Activities (10 minutes each)

Show and Tell
  • Ask for volunteers to show the maze game they created. How did they program the character(s) to move? Did anyone add sound effects? Who drew their own Actors?

Discussion
Ask students:
  • Who can list the four directions we programmed the Actors to move? (Answer: up, right, down, left)
  • Who can describe what the "if-then" code block is doing?
  • What is one thing you learned about keyboard control (web) or tilt control (mobile) interactions?
  • What is something you enjoyed about today’s lesson?
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