« Middle School Courses
This course is included with our Coding/STEAM Curriculum - Middle School Plan

Students learn to create programs of moderate complexity with variables, functions, and advanced physics. They will even program their own hero and enemy A.I.

  • Grades 7+
  • Advanced
  • Web

Description

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.

Topics

  • List variables
  • Structured data
  • Loops
  • Advanced flow control
  • Physics attributes
  • Velocity
  • Impulses
  • Collisions
  • Sending and receiving messages
  • Parameters
  • Functions
  • Advanced conditional logic
  • Math
  • Boolean operators

What Students Learn

  • Build a complete projectile-based physics game
  • Build a complete platformer game using physics
  • Programmatically generate never-ending platforms
  • Program a hero with multiple actions and access them via keys
  • Use cloud variables and a list data structure to implement a leaderboard
  • Use variables to keep score and game speed
  • Program enemy A.I.

Technical Requirements

* 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

Introduction

Welcome 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.

Vocabulary

  • Gravity: The force that pulls objects towards Earth’s center

Objectives

Students will...
  • Use code blocks to create projects that use physics
  • Apply coding concepts to solve a puzzle module

Materials

  • 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.
2. Concepts (Video)
  • 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.
3. Turn on Physics (DIY)
  • 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?
4. Set Active or Static (DIY)
  • 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.
5. Land the Alien (Puzzle)
  • 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?
6. Create Your Own Structure (DIY)
  • 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:
    https://www.tynker.com/support/backpack
7. Quiz (Multiple-choice)
  • 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?

U.S. Standards

  • 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. Standards

Key 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.
Key Stage 3 (Years 7-9)
  • 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.

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
Object Stacking
25 Slides
Lesson 2
Applying Impulses
21 Slides
Lesson 3
Line Animation
26 Slides
Lesson 4
Physics Properties
24 Slides
Lesson 5
Ricochet
23 Slides
Lesson 6
Explosions
26 Slides
Lesson 7
Changing Direction
21 Slides
Lesson 8
Gravity Sling
19 Slides
Lesson 9
Linear Velocity
20 Slides
Lesson 10
Double Jump
18 Slides
Lesson 11
Receiving Values
21 Slides
Lesson 12
Lists
23 Slides
Lesson 13
Laser Tennis
18 Slides
Lesson 14
Enemy AI
20 Slides
Lesson 15
Leaderboards
20 Slides
Lesson 16
Platform Movement
18 Slides