Lesson Plan

Lesson: Keyboard Interaction
Time: 60+ mins


In this lesson, students will program input controls to move Actors.

Code Blocks

  • : Run code attached to this block when you press a specified key.
  • : Change the x-coordinate of an Actor by the specified number of pixels.


  • None


Students will...
  • Use keyboard (web) or tilt controls (mobile) to move characters
  • Create unique controls to move Actors


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

Warm-Up (15 minutes)

Review the following terms with your students. They will use these in today’s lesson:
  • Horizontal axis (x-axis): The line on a graph or coordinate plane that runs horizontally (left-right)
  • Vertical axis (y-axis): The line on a graph or coordinate plane that runs vertically (up-down)
  • x-value: Horizontal (left-right) value along a coordinate plane
  • y-value: Vertical (up-down) value along a coordinate plane
Ask your students...
  • Have we seen these terms before? (Yes, in the "Jumping Over Obstacles" lesson)
  • Who remembers which code block we used to make the Actor move in the up-down direction? ("change y by" block)
  • Does the "x-value" move in the left-right or up-down direction? (left-right)
  • If we wanted to make an Actor move left or right, would we use a "change x by" block or a "change y by" block? ("change x by" block)

Activities (45 minutes)

Facilitate as students complete all Keyboard Interaction modules on their own:
1. Move to Collect Power Cells (Video)
  • Students will watch a short video that introduces the upcoming programming activity.
  • Optional: Read the captions on the screen to your students.
2. Move Back and Forth Example (Example)
  • Students will view an interactive project of Gus moving, which they will create their own version of in the next module!
  • Tell students to use their left and right arrow keys (web) or tilt their screen left and right (mobile) to move Gus.
  • Tell students to click the red button to move on to the next module.
3. Move Back and Forth (DIY)
  • In this DIY (do-it-yourself) project, students will program Gus to respond to keyboard (web) or tilt (mobile) commands!
  • Tell students that the "change x by" block uses both positive and negative values to make Gus move horizontally (left-right).
  • Check that students understand that the background doesn’t shift Gus to the left--his code moves him independently of other Actors (i.e., the Stage).
4. Move and Collect Power Cells (Puzzle)
  • To solve this puzzle module, students will need to program Gus to move back and forth to catch power cells!
  • Give a hint: Tell students to use a negative 10 value inside one of the "change x by" blocks to make Gus move backwards (to the left).
5. Make Actors Move Example (Example)
  • Students will view a project where the alien moves when arrow keys (web) or tilt controls (mobile) are used.
6. Make Actors Move (DIY)
  • In this DIY project, students will program an Actor to move up, down, left, and right using keyboard (web) or tilt (mobile) controls!
  • Remind students that the "change y by" block moves the Actor up and down, depending on the value inside the block. For example, a "-10" will move the Actor down, whereas a "10" will move the Actor up.
7. Quiz (Multiple Choice)
  • Students will answer 5 multiple choice questions to review concepts covered in this lesson.

Extended Activities (20 minutes)

Lead a mini-discussion with your students:
  • Who can list the four directions we programmed the Actors to move? (Up, right, down, left)
  • True or false: The "change x by" block moves the Actor up or down. (False)
  • How is the "change x by" block different from the "change y by" block? (The "change x by" block moves the character horizontally, whereas the "change y by" block moves the character vertically)
  • What is something you struggled with in today’s lesson? How did you troubleshoot the problem?
  • What is something you enjoyed about today’s lesson?

U.S. Standards

  • CCSS-Math: MP.1
  • CCSS-ELA: RF.1.1, RF.2.4, RF.2.4.A, RF.3.4.A, RF.4.4.A, RI.2.6
  • CSTA: 1B-AP-10, 1B-AP-11, 1B-AP-15
  • CS CA: 3-5.AP.12, 3-5.AP.13, 3-5.AP.17
  • ISTE: 1.c, 1.d, 4.d, 5.c, 5.d, 6.b
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
27 Slides
Lesson 2
Loops and Animation
19 Slides
Lesson 3
Creating a Scene
21 Slides
Lesson 4
Jumping over Obstacles
20 Slides
Lesson 5
23 Slides
Lesson 6
User Interaction
19 Slides
Lesson 7
Guessing Game
22 Slides
Lesson 8
20 Slides
Lesson 9
Alien Invaders
17 Slides
Lesson 10
Music and Animation
18 Slides
Lesson 11
Instruments and Tempo
19 Slides
Lesson 12
Broadcasting Messages
18 Slides
Lesson 13
Time Limits
17 Slides
Lesson 14
Message Driven Programming
18 Slides
Lesson 15
Pop the Balloon
18 Slides
Lesson 16
Animation with Movement
18 Slides
Lesson 17
Obstacle Course
19 Slides