In this advanced lesson plan, students will be introduced to the physics library as they build Gravity Sling, a projectile game inspired by Angry Birds (TM). They define the behaviors of different kinds of projectiles and use physics commands such as impulse, gravity and collisions to build the game. Ninja Runner is an advanced physics platformer game with a boss fight sequence that challenges them to apply all the concepts and skills they have learned.
Students who successfully complete this lesson plan will demonstrate excellent understanding of a variety of programming concepts and computational thinking skills, and will be able to design and implement projects of moderate to advanced complexity.
- List variables
- Structured data
- Advanced flow control
- Physics attributes
- Sending and receiving messages
- Advanced conditional logic
- Boolean operators
* Online courses require a modern desktop computer, laptop computer, Chromebook, or Netbook with Internet access and a Chrome (29+), Firefox (30+), Safari (7+), or Edge (20+) browser. No downloads required.
Programming 302 Lesson Plan
Lesson: Object Stacking
Time: 60+ mins
IntroductionWelcome to the first lesson in the Programming 302 course! In this lesson, students will learn the basics of Tynker’s physics engine. Additionally, students will create physics-themed projects and solve a puzzle module while reinforcing the following programming/coding concepts: Physics/Gravity, Set Shape To, and Set Active/Static.
New Code Blocks
: Enable the physics engine to run physics blocks. : Stop the physics engine from running physics blocks. : Set whether the Actor uses physics and can affect other Actors that use physics. : Set whether the Actor (if active) is unaffected by gravity or collisions. An Actor that is not static will fall due to gravity, while an Actor that is static will not. : Set whether the Actor will be rectangular or circular when interacting with Actors (e.g., collisions). : Set the horizontal and vertical forces of gravity. : Point the Actor at the specified degree. : Move the Actor to the specified x- and y-coordinates on the Stage.
- Gravity: The force that pulls objects towards Earth’s center
- Use code blocks to create projects that use physics
- Apply coding concepts to solve a puzzle module
- Computers, laptops, or mobile devices (1 per student) with student account access to Tynker.com
Warm-Up (15 minutes)
- Tell your students that today’s lesson introduces physics concepts.
- Review basic concepts with your students. For example, tell students that gravity is what makes objects fall to the ground. Ask students what happens when you throw a ball in the air. (Answer: It comes back down.) Can anyone give other examples of how gravity affects our everyday lives?
Activities (45 minutes)Facilitate as students complete all Object Stacking modules on their own:
1. Introduction (Video)
- Students are introduced to the upcoming activity by playing a Gravity Sling game.
- How to play: Tell students to click (for web) or tap (for mobile) and drag the Gravity Antenna to practice launching asteroids.
- A friendly alien introduces three coding concepts:
- Physics/Gravity- Students are introduced to the “start physics” and "stop physics” code blocks. Additionally, students are introduced to the concept of gravity and will observe how Actors are affected by the “set gravity to” code block.
- Set Shape To- Students are asked to guess which Actors are set to rectangular or circular shapes.
- Set Active/Static- Students will observe how the “set active” and “set static” code blocks affect Actors.
- In this DIY (do-it-yourself) project, students will follow step-by-step directions to program aliens to fall down using the Tynker physics engine.
- Point out to students that the Stage Actor's “set active false” block allows the aliens to fall past the edges of the Stage. Also explain that making the Stage inactive is what turns the Stage's edge collision off.
- Optional: Ask students to guess what will happen to the Actors if they change the “set active” code block to true. After they complete this action, ask: Did they guess correctly?
- In this DIY project, students will explore different configurations of the “set active” and “set static” code blocks.
- Optional: Ask students to experiment with the different parameters. For example, students can set the "set Active" and "set Static" code block to "true" or "false" and see the effects.
- To solve this puzzle module, students will need to program three different Actors: sci fi platform, alien creature, and stone platform. The goal of the puzzle is to build a bridge for the alien to stand on so it can catch a powercell.
- Are students struggling? Ask them to change the code blocks' parameters one at a time and note changes. Did their modifications work as expected?
- In this DIY project, students will apply concepts and code blocks learned in this lesson to build a structure that is held together by gravity! The project is open-ended, so students are encouraged to create any type of structure they like.
- Students can also use saved Actors and code from previous activities by using the backpack tool:
- You can learn more about the backpack tool here:
- Students will answer 5 multiple-choice questions to review concepts from this lesson.
Extended Activities (10 minutes)Ask students:
- What are some benefits of incorporating physics into your projects? (Example: Using Tynker’s physics engine makes the Actors seem a lot more realistic.)
- What is something you learned from today’s coding adventure?
- CCSS-Math: 6.NS.C, MP.1
- CCSS-ELA: 6-8.RST.3, 6-8.RST.4, 6-8.RST.7
- CSTA: 2-AP-11, 2-AP-13, 2-AP-15, 2-AP-16, 2-AP-17
- CS CA: 6-8.AP.11, 6-8.AP.13, 6-8.AP.15, 6-8.AP.16, 6-8.AP.17
- ISTE: 1.c, 1.d, 4.d, 5.c, 5.d, 6.b
U.K. StandardsKey Stage 2 (Years 4-6)
- Design, write and debug programs that accomplish specific goals, including controlling or simulating physical systems; solve problems by decomposing them into smaller parts.
- Use logical reasoning to explain how some simple algorithms work and to detect and correct errors in algorithms and programs.
- Understand computer networks, including the internet; how they can provide multiple services, such as the World Wide Web, and the opportunities they offer for communication and collaboration.
- Use technology safely, respectfully and responsibly; recognise acceptable/unacceptable behaviour; identify a range of ways to report concerns about content and contact.
- 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.