Programming 101 Lesson Plan
Lesson: Color Sensing
Time: 60+ mins
IntroductionIn this a-MAZE-ing lesson, students will create a game where characters need to navigate through a maze while avoiding enemies! Additionally, students will learn about win and loss conditions, and how to program color-touch events.
New Code Blocks
: Return true if the Actor is touching the specified color. : Stop playing all sounds. : Stop playing all the scripts.
- Apply coding concepts to detect if an Actor is touching a certain color or Actor
- Create a game where characters need to navigate through a maze and avoid enemies
- Computers, laptops, or mobile devices (1 per student) with student account access to Tynker.com
Warm-Up (15 minutes)Lead a mini-discussion with your students:
- Tell students that they are going to create a maze game using Tynker!
- Ask students to raise their hand if they’ve played an online maze game.
- Discuss common features of maze games. (They have walls with dead ends, sometimes include enemies or obstacles, usually include a “start” and “finish” location)
- Ask, “What do you think makes a good maze game? Is it the sound? Music? Level of difficulty?”
- If students were to create their own maze, what features would they include?
Activities (45 minutes)Facilitate as students complete all Color Sensing modules on their own:
1. Dr. Glitch Takes Codey! (Video)
- Students will watch a short video where Dr. Glitch captures Codey, and students must win a game to have Codey returned!
- This module introduces three coding concepts:
- “Touching color?” block- This is a condition block that detects when the Actor touches a certain color. The color is specified using a computer code inside the block. The modules will guide students on what code to enter here.
- "Touching?" block- This blocks detects if one Actor is touching a specified Actor, or the edge of the Stage.
- "Stop all sounds" block- This block stops playing all sounds in the program.
- Students will view a maze game project, similar to what students will be creating in the next few modules.
- Tell students to use arrow keys (for web) or tilt controls (for mobile) to move the color block to the green “Exit” sign.
- In this DIY project, students will program a maze game that’s different every time the user plays it!
- Activities include randomizing the Stage background, programming the mouse to glow random colors, and programming the mouse to appear somewhere random on the Stage.
- Tell students that they will add more features to this maze game in the next few modules.
- In this DIY project, students will continue developing their maze code by programming arrow keys (for web) or tilt controls (for mobile).
- Emphasize to students that the “touching color?” block is used to detect when the “mouse” touches a black wall of the maze.
- Notice when the program runs, that bumping into the wall and then moving back happens so quickly, it looks like it’s not happening at all! Do students want to make it more obvious when they run into the wall? Ask them to add a “wait” block or add a sound.
- In this DIY project, students will create an ending for their maze game by including a “Game Over” message.
- In this DIY project, students will continue improving their maze game by adding sounds, keeping score, and drawing a trail through the maze.
- Students are reminded about using the “stamp” code block, which leaves a trail of clone copies of the dot.
- Optional: Encourage the adventurous coder to make an Actor appear and say “Watch out for the walls!” when the user bumps into a wall.
- To solve this puzzle, students will need to program Codey to navigate a maze, then successfully move Codey to the treasure chest without hitting white maze walls or ghosts!
- Are students struggling? Remind them which direction the given “change” blocks move Codey. For example, the “change y by -10” block moves Codey in the downward direction along the y-axis.
- Students will view an example of a race game!
- Tell students to click or tap the screen to start the car and use the left and right arrow keys (for web) or tilt left or right (for mobile) to turn.
- In this DIY project, students will program a race car and navigate it around the track!
- Does the car not detect when it’s touching the grass? Check that the color inside your students’ “touching color?” block is set to “#196d3f.” This is the color of the grass.
- Did students finish early? Direct their attention to the “Bonus” activity in “Step 7/8" of the tutorial, which encourages students to program a boost effect.
- Students will be asked 5 multiple-choice questions to review concepts from this lesson.
Extended Activities (10 minutes each)Reflection:
Lead a discussion with your students, reflecting on Programming 101 experiences:
- What was your favorite activity in the Programming 101 course?
- What do you enjoy about coding?
- What do you find challenging about coding?
- What was one of the most challenging lessons for you or someone you know?
- If you could go back to a previous project and improve it, which one would you improve? How would you improve it?
Race Car Tricks:
- Point out to students, in case no one has figured it out yet, that it’s possible to cheat and win in the Race Car game! Students can turn the car around and go forward a little bit to cross the line! What kind of coding could they do to ensure that a car actually needs to travel all the way around the track to win? Ask them to offer ideas, and see if they can come up with more than one possible solution.
- CCSS-Math: 1.NBT.B.2, 2.OA.B.2, 3.NBT.A.2, 5.G.A.1, 6.NS.C.6, 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: 1A-AP-09, 1A-AP-10, 1A-AP-11, 1A-AP-14, 1B-AP-10, 1B-AP-11, 1B-AP-12, 1B-AP-15
- CS CA: K-2.AP.12, K-2.AP.13, K-2.AP.16, 3-5.AP.13, 3-5.AP.14, 3-5.AP.17
- ISTE: 1.c, 1.d, 4.d, 5.c, 5.d, 7.c
U.K. StandardsNational Curriculum of England (Computing)
Key Stage 3:
- Design, use, and evaluate computational abstractions that model the state and behaviour of real-world problems and physical systems
- 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
- Use two or more programming languages, at least one of which is textual, to solve a variety of computational problems; make appropriate use of data structures (for example, lists, tables, or arrays); design and develop modular programs that use procedures or functions
- Understand simple Boolean logic (for example, AND, OR, and NOT) and some of its uses in circuits and programming; understand how numbers can be represented in binary, and be able to carry out simple operations on binary numbers (for example, binary addition, and conversion between binary and decimal)
- Understand how instructions are stored and executed within a computer system; understand how data of various types (including text, sounds, and pictures) can be represented and manipulated digitally, in the form of binary digits
- Develop their capability, creativity, and knowledge in computer science, digital media, and information technology
- Develop and apply their analytic, problem-solving, design, and computational thinking skills
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..
Make a Birthday Card
The Music Machine