High School course

Programming 302

  • STANDARDS 7+
  • ADVANCED
  • WEB
  • 16 LESSONS
Request Quote
Slide: 1 of 0

Answer Key

Module 3: Turn on Physics

Module 4: Set Active or Static

Module 5: Land the Alien

Module 6: Create Your Own Structure

Module 7: Quiz

1. What does the {"func":"blockPhysicsStart"} block do?

  • It enables physics, allowing the Actors on the Stage to collide and fall
  • It enables animations
  • It enables the space theme
  • It allows you to move Actors left and right with the arrow keys

2. What does the {"func":"blockPhysicsSetGeometry","values":[{"type":"choice","value":"rectangular"}]} block do?

  • It makes the Actor collide like a rectangle when physics are enabled
  • It makes the Actor collide like a circle when physics are enabled
  • It changes the appearance of the Actor into a rectangle
  • It changes the appearance of the Actor into a circle

3. Which of these blocks could be used to make a platform collide without rotating?

  • {"func":"blockPhysicsSetGeometry","values":[{"type":"choice","value":"rectangular"}]}
  • {"func":"blockPhysicsSetGeometry","values":[{"type":"choice","value":"circular"}]}
  • {"func":"blockMotionGoTo","values":[{"type":"number","value":"0"},{"type":"number","value":"0"}]}
  • {"func":"blockMotionPointDirection","values":[{"type":"string","value":"90"}]}

4. What is the difference between these two code blocks? {"func":"blockPhysicsSetGeometry","values":[{"type":"choice","value":"rectangular"}]}{"func":"blockPhysicsSetGeometry","values":[{"type":"choice","value":"circular"}]}

  • If an Actor’s shape is set to rectangular, it will behave like a block. If an Actor’s shape is set to circular, it will behave like a ball.
  • If an Actor’s shape is set to rectangular, it will behave like a ball. If an Actor’s shape is set to circular, it will behave like a block.
  • If an Actor’s shape is set to rectangular, it will look like a block. If an Actor’s shape is set to circular, it will look like a ball.
  • If an Actor’s shape is set to rectangular, it will look like a ball. If an Actor’s shape is set to circular, it will look like a block.

5. Which of these code blocks allows other objects to collide with an Actor?

  • {"func":"blockPhysicsSetActive","values":[{"type":"boolean","value":"true"}]}
  • {"func":"blockPhysicsSetActive","values":[{"type":"boolean","value":"false"}]}
  • {"func":"blockPhysicsSetStatic","values":[{"type":"boolean","value":"false"}]}
  • {"func":"blockPhysicsSetStatic","values":[{"type":"boolean","value":"true"}]}

6. Which of these code blocks allows the Actor to fall as a result of gravity?

  • {"func":"blockPhysicsSetActive","values":[{"type":"boolean","value":"true"}],"next":{"func":"blockPhysicsSetStatic","values":[{"type":"boolean","value":"false"}]}}
  • {"func":"blockPhysicsSetActive","values":[{"type":"boolean","value":"true"}],"next":{"func":"blockPhysicsSetStatic","values":[{"type":"boolean","value":"true"}]}}
  • {"func":"blockPhysicsSetActive","values":[{"type":"boolean","value":"false"}],"next":{"func":"blockPhysicsSetStatic","values":[{"type":"boolean","value":"true"}]}}
  • {"func":"blockPhysicsSetActive","values":[{"type":"boolean","value":"false"}],"next":{"func":"blockPhysicsSetStatic","values":[{"type":"boolean","value":"false"}]}}

7. Sharon wants to have an Actor in her game that just displays the title of the game, but the text falls to the ground when she hits play! Which of these blocks is she missing?

  • {"func":"blockPhysicsSetActive","values":[{"type":"boolean","value":"false"}]}
  • {"func":"blockPhysicsSetGeometry","values":[{"type":"choice","value":"circular"}]}
  • {"func":"blockPhysicsStart"}
  • {"func":"blockLooksHide"}

8. Which of these code blocks would we use to allow a round Actor to roll down a hill?

  • {"func":"blockPhysicsSetGeometry","values":[{"type":"choice","value":"circular"}]}
  • {"func":"blockPhysicsSetGeometry","values":[{"type":"choice","value":"rectangular"}]}
  • {"func":"blockLooksHide"}
  • {"func":"blockLooksShow"}

9. When physics is turned on, what are the default Active/Static settings for an Actor?

  • {"func":"blockPhysicsSetActive","values":[{"type":"boolean","value":"true"}],"next":{"func":"blockPhysicsSetStatic","values":[{"type":"boolean","value":"false"}]}}
  • {"func":"blockPhysicsSetActive","values":[{"type":"boolean","value":"false"}],"next":{"func":"blockPhysicsSetStatic","values":[{"type":"boolean","value":"true"}]}}
  • {"func":"blockPhysicsSetActive","values":[{"type":"boolean","value":"true"}],"next":{"func":"blockPhysicsSetStatic","values":[{"type":"boolean","value":"true"}]}}
  • {"func":"blockPhysicsSetActive","values":[{"type":"boolean","value":"false"}],"next":{"func":"blockPhysicsSetStatic","values":[{"type":"boolean","value":"false"}]}}

10. Alex wants to program a ball to bounce off the walls. Which code block should he put in the code for the walls?

  • {"func":"blockPhysicsSetActive","values":[{"type":"boolean","value":"true"}],"next":{"func":"blockPhysicsSetStatic","values":[{"type":"boolean","value":"true"}]}}
  • {"func":"blockPhysicsSetActive","values":[{"type":"boolean","value":"true"}],"next":{"func":"blockPhysicsSetStatic","values":[{"type":"boolean","value":"false"}]}}
  • {"func":"blockPhysicsSetActive","values":[{"type":"boolean","value":"false"}],"next":{"func":"blockPhysicsSetStatic","values":[{"type":"boolean","value":"false"}]}}
  • {"func":"blockPhysicsSetActive","values":[{"type":"boolean","value":"false"}],"next":{"func":"blockPhysicsSetStatic","values":[{"type":"boolean","value":"true"}]}}

11. True or false: Using the {"func":"blockPhysicsSetGeometry","values":[{"type":"choice","value":""}]} block changes the appearance of the Actor.

  • True
  • False

12. True or false: The Actor will still fall if you remove all {"func":"blockPhysicsStart"} blocks from the project.

  • True
  • False

13. True or false: The Actors on the Stage will not fall if you use this block. {"func":"blockPhysicsSetGravity","values":[{"type":"number","value":"0"},{"type":"number","value":"0"}]}

  • True
  • False

14. True or false: The Actor will fall downwards if you place it at the top of the screen and use the {"func":"blockPhysicsStart"} block.

  • True
  • False

15. True or false: If an Actor is active and static, that means that other objects can collide with it, but it won't fall as a result of gravity.

  • True
  • False

U.S. Standards

  • CCSS-Math: 6.NS.C.6, MP.1
  • CCSS-ELA: 6-8.RST.3, 6-8.RST.4, 6-8.RST.7, RI.9-10.3, RI.11-12.3
  • CSTA: 2-AP-10, 2-AP-11, 2-AP-13, 2-AP-15, 2-AP-16, 2-AP-17, 3A-AP-17, 3A-AP-22
  • CS CA: 6-8.AP.11, 6-8.AP.13, 6-8.AP.15, 6-8.AP.16, 6-8.AP.17, 9-12.AP.12, 9-12.AP.16
  • ISTE: 1.c, 1.d, 4.d, 5.c, 5.d, 6.b

U.K. Standards

Key stage 3
Pupils should be taught to:
  • 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
  • undertake creative projects that involve selecting, using, and combining multiple applications, preferably across a range of devices, to achieve challenging goals, including collecting and analysing data and meeting the needs of known users
  • create, reuse, revise and repurpose 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
Key stage 4
All pupils must have the opportunity to study aspects of information technology and computer science at sufficient depth to allow them to progress to higher levels of study or to a professional career. Pupils should be taught to:
  • 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
  • understand how changes in technology affect safety, including new ways to protect their online privacy and identity, and how to report a range of concerns

Lesson 1: Object Stacking

Course: | Web

  • Introduction
  • Concepts
  • Turn on Physics
  • Set Active or Static
  • Land the Alien
  • Create Your Own Structure
  • Quiz

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.