Middle School course

Programming 202

  • GRADES 5-6
  • INTERMEDIATE
  • WEB IPAD
  • 16 LESSONS
Slide: 1 of 21

Answer Key

Module 4: Learn to Fire Targets

Module 5: Fix the Impulse

Module 7: Get the Dynamite

Module 8: Quiz

1. Which of these blocks fires the cannonball?

  • {"func":"blockPhysicsApplyImpulse","values":[{"type":"number","value":"50"}]}
  • {"func":"blockPhysicsStop"}
  • {"func":"blockPhysicsSetRestitution","values":[{"type":"number","value":"0.2"}]}
  • {"func":"blockPhysicsSetStatic","values":[{"type":"boolean","value":"true"}]}

2. What will this code block do to an actor? {"func":"blockPhysicsApplyImpulse","values":[{"type":"number","value":"50"}]}

  • It will push the Actor forward towards whatever direction it's facing by applying a sudden force
  • It will always push the Actor up regardless of what direction it's facing
  • It will start physics
  • It will set how bouncy the Actor is

3. Which code block will push the Actor forward towards whatever direction it's facing the most?

  • {"func":"blockPhysicsApplyImpulse","values":[{"type":"number","value":"500"}]}
  • {"func":"blockPhysicsApplyImpulse","values":[{"type":"number","value":"50"}]}
  • {"func":"blockPhysicsApplyImpulse","values":[{"type":"number","value":"5"}]}
  • {"func":"blockPhysicsApplyImpulse","values":[{"type":"number","value":".5"}]}

4. What will this code block do to an Actor? {"func":"blockPhysicsApplyImpulse","values":[{"type":"number","value":"-50"}]}

  • It will push the Actor backwards away from whatever direction it's facing
  • It will push the Actor forward towards whatever direction it's facing
  • It will always push the Actor up regardless of what direction it's facing
  • It will always push the Actor down regardless of what direction it's facing

5. Taylor wants to program a game where her Actor jumps when the up key is pressed. Instead of using the Change Y By block, Taylor wants to apply an impulse upwards. Which of these code blocks will help her program her character to jump up using an impulse?

  • {"func":"registerKeyTrigger","values":[{"type":"choice","value":"up arrow"}],"next":{"func":"blockPhysicsApplyImpulseAngle","values":[{"type":"number","value":"50"},{"type":"number","value":"0"}]}}
  • {"func":"blockControlForeverIf","values":[{"type":"wrapper","func":"valueSensingKeyPressed","values":[{"type":"choice","value":"space"}]}],"containers":[{"func":"blockPhysicsApplyImpulse","values":[{"type":"number","value":"0"}]}]}
  • {"func":"registerKeyTrigger","values":[{"type":"choice","value":"up arrow"}],"next":{"func":"blockPhysicsSetRestitution","values":[{"type":"number","value":"50"}]}}
  • {"func":"registerKeyTrigger","values":[{"type":"choice","value":"up arrow"}],"next":{"func":"blockPhysicsStart"}}

6. Richard wants to program a game where a pile of boulders explodes when the player shoots a projectile into the pile. Which of these code blocks will help him do that?

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

7. True or false: Generally speaking, the smaller the value in the apply impulse block, the farther the object moves.

  • True
  • False

8. True or false: An active, non-static Actor can bounce off of other objects.

  • True
  • False

9. Which block is used to shoot the cannonball in the direction of the mouse?

  • {"func":"blockMotionPointTowards","values":[{"type":"string","value":"mouse-pointer"}]}
  • {"func":"blockMotionPointTowards","values":[{"type":"string","value":"self"}]}
  • {"func":"blockMotionGoTowards","values":[{"type":"string","value":"mouse-pointer"}]}
  • {"func":"blockPhysicsSetStatic","values":[{"type":"boolean","value":"true"}]}

10. Xavier 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":"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":"false"}]}}
  • {"func":"blockPhysicsSetActive","values":[{"type":"boolean","value":"false"}],"next":{"func":"blockPhysicsSetStatic","values":[{"type":"boolean","value":"true"}]}}

11. True or false: Active, non-static Actors will stay in the air but still allow other objects to bounce off of them.

  • True
  • False

12. True or false: Active, static walls will stay in the air but still allow other objects to bounce off of them.

  • True
  • False

13. Which block is used to position the cannonball at the location of the cannon before it is shot?

  • {"func":"blockMotionGoTowards","values":[{"type":"string","value":"cannon"}]}
  • {"func":"blockMotionGoTowards","values":[{"type":"string","value":"mouse-pointer"}]}
  • {"func":"blockMotionChangeXBy","values":[{"type":"number","value":"10"}]}
  • {"func":"blockMotionChangeYBy","values":[{"type":"number","value":"10"}]}

14. Jenny wants to place one of her Actors right on top of another Actor, called Actor1, without using XY coordinates. Which block would she use to do this?

  • {"func":"blockMotionGoTowards","values":[{"type":"string","value":"mouse-pointer"}]}
  • {"func":"blockMotionGoTowards","values":[{"type":"string","value":"self"}]}
  • {"func":"blockMotionGoTowards","values":[{"type":"string","value":"Actor1"}]}
  • {"func":"blockMotionGoTowards","values":[{"type":"string","value":"right edge"}]}

15. What can you do to decrease the distance the cannonball travels?

  • Decrease the value in the 'Apply Impulse' block
  • Stop physics when the cannonball lands
  • Use a Forever loop
  • Increase the value in the 'Apply Impulse' block

16. What direction does this block apply the impulse in? {"func":"blockPhysicsApplyImpulse","values":[{"type":"number","value":"50"}]}

  • It applies the impulse in the direction the actor is facing
  • It applies the impulse along the y axis
  • It applies the impulse along the x axis
  • It applies the impulse towards the left side of the screen

17. Vanessa wants to program a game where the bricks fall down after getting hit by the cannonball. Which code blocks will help her do that?

  • She should put this in the bricks' code: {"func":"blockControlForever","containers":[{"func":"blockControlIf","values":[{"type":"wrapper","func":"valueSensingTouchingSprite","values":[{"type":"string","value":"cannonball"}]}],"containers":[{"func":"blockPhysicsSetStatic","values":[{"type":"boolean","value":"false"}]}]}]}
  • She should put this in the bricks' code: {"func":"blockControlForever","containers":[{"func":"blockControlIf","values":[{"type":"wrapper","func":"valueSensingTouchingSprite","values":[{"type":"string","value":"cannonball"}]}],"containers":[{"func":"blockPhysicsSetStatic","values":[{"type":"boolean","value":"true"}]}]}]}
  • She should put this in the cannonball's code: {"func":"blockControlIf","values":[{"type":"wrapper","func":"valueSensingTouchingSprite","values":[{"type":"string","value":"brick"}]}],"containers":[{"func":"blockPhysicsSetStatic","values":[{"type":"boolean","value":"true"}]}]}
  • She should put this in the cannonball's code: {"func":"blockControlIf","values":[{"type":"wrapper","func":"valueSensingTouchingSprite","values":[{"type":"string","value":"brick"}]}],"containers":[{"func":"blockPhysicsSetActive","values":[{"type":"boolean","value":"false"}]}]}

18. True or false: An Actor cannot be both static and active.

  • True
  • False

19. Xavier wants to program a ball to bounce. What block can he use to adjust how bouncy it is?

  • {"func":"blockPhysicsSetRestitution","values":[{"type":"number","value":"0.2"}]}
  • {"func":"blockPhysicsSetStatic","values":[{"type":"boolean","value":"true"}]}
  • {"func":"blockPhysicsSetActive","values":[{"type":"boolean","value":"false"}]}
  • {"func":"blockLooksSetSize","values":[{"type":"number","value":"100"}]}

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

  • {"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"}]}}

U.S. Standards

  • CCSS-Math: MP.1
  • CCSS-ELA: RF.5.4.A, 6-8.RST.3, 6-8.RST.4, 6-8.RST.7
  • CSTA: 1B-AP-10, 1B-AP-11, 1B-AP-15, 2-AP-13, 2-AP-16, 2-AP-17
  • CS CA: 3-5.AP.10, 3-5.AP.12, 3-5.AP.13, 3-5.AP.14, 3-5.AP.17, 6-8.AP.13, 6-8.AP.16, 6-8.AP.17
  • ISTE: 1.c, 1.d, 4.d, 5.c, 5.d, 7.c

U.K. Standards

Key stage 2
Pupils should be taught to:
  • design, write and debug programs that accomplish specific goals, including controlling or simulating physical systems; solve problems by decomposing them into smaller parts
  • use sequence, selection, and repetition in programs; work with variables and various forms of input and output
  • 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 search technologies effectively, appreciate how results are selected and ranked, and be discerning in evaluating digital content
  • select, use and combine a variety of software (including internet services) on a range of digital devices to design and create a range of programs, systems and content that accomplish given goals, including collecting, analysing, evaluating and presenting data and information
  • 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
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

Lesson 13: Impulses

Course: | iPad Web

  • Introduction
  • Concepts
  • Learn to fire Targets Example
  • Learn to Fire Targets
  • Fix the Impulse
  • Get the Dynamite Example
  • Get the Dynamite
  • Quiz

Description

Help your students advance their skills as they build Paint Racer, a pen-drawing game, and Cannon Crasher, a physics game. Harness the power of the physics engine to easily program realistic jumps and bouncing balls. Upon completing this lesson plan, students will be able to use model physics properties and generate math art.

Topics

  • Geometric patterns
  • Angles
  • Projectile physics
  • Physics engine
  • Gravity
  • Hit boxes
  • Collisions
  • Bouncing
  • Static platforms
  • Impulse
  • Velocity and force
  • Timers
  • Interactions between objects
  • Special effects

What Students Learn

  • Draw shapes and patterns using pen drawing commands
  • Program fluid motion with keyboard control
  • Control Actors using messaging
  • Define and use functions with parameters
  • Build physics projects using gravity, impulse, and velocity
  • Build their own versions of classic arcade games

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.
* Tablet courses require an iPad (iOS 10+) with Tynker or Tynker Junior app installed and Internet access