Lesson: Motion and Tracking
Time: 60+ mins
IntroductionNow 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?
: 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.
- 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
- Use code blocks to program Actors to move in specific directions
- Use code blocks to solve a puzzle module
- Create a maze game
- 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.
- 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.
- 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.
- 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)
- 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.
- 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?
- 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?
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