High School course

Programming 302

  • GRADES 7+
  • ADVANCED
  • WEB
  • 16 LESSONS
Slide: 1 of

Answer Key

Module 2: Learn to Shoot

Module 3: Hit the Enemy

Module 4: Defeat the Robots

Module 5: Create Your Own 2D Shooter

Module 6: Quiz

1. Which code block is use to send a message to just one Actor on the Stage?

  • {"type":"wrapper","func":"valueControlMessageSource"}
  • {"func":"blockControlPostMessage","values":[{"type":"string","value":""},{"type":"string","value":"bee_actor"},{"type":"string","value":""}]}
  • {"func":"blockControlBroadcast","values":[{"type":"string","value":""}]}
  • {"func":"registerBroadcastTrigger","values":[{"type":"string","value":""}]}

2. Ashley's brother is graduating from high school and she wants to make him a card. She wants the card to say "Congratulations!" on the front, but have a different message on the inside. Which event block can she use to change the message when the card is open vs. closed? (Select all answers that apply)

  • {"func":"registerFlagTrigger"}
  • {"func":"registerBackgroundChange","values":[{"type":"string","value":""}]}
  • {"func":"registerBroadcastTrigger","values":[{"type":"string","value":""}]}
  • {"func":"blockLooksChangeEffect","values":[{"type":"choice","value":"color"},{"type":"number","value":"25"}]}

3. Tom wants to make a message on the Stage blink on and off. He adds these code blocks: {"func":"registerFlagTrigger","next":{"func":"blockControlForever","containers":[{"func":"blockLooksHide","next":{"func":"blockControlWait","values":[{"type":"number","value":".5"}]}}]}}. What will happen when he runs the program?

  • The message will never appear!
  • The message will appear but won't blink
  • The message will blink
  • The message will appear for .5 seconds and then disappear forever

4. What block is needed to receive the message from a broadcast block?

  • {"func":"registerBroadcastTrigger","values":[{"type":"string","value":""}]}
  • {"func":"blockControlBroadcast","values":[{"type":"string","value":""}]}
  • {"func":"blockSoundPlayUntilDone","values":[{"type":"string","value":""}]}
  • {"func":"registerFlagTrigger"}

5. True or False: An Actor can send and receive multiple messages.

  • True
  • False

6. True or False: If you broadcast the message "dance", only the actors who have a {"func":"registerBroadcastTrigger","values":[{"type":"string","value":"dance"}]} block will respond.

  • True
  • False

7. True or False: This block can only return user defined variables. {"type":"wrapper","func":"valueVarPropGet","values":[{"type":"string","value":""},{"type":"string","value":"any"}]}

  • True
  • False

8. What block will store the value stored in the last parameter of the "Send Message" block? {"func":"blockControlPostMessage","values":[{"type":"string","value":""},{"type":"string","value":"any"},{"type":"string","value":""}]}

  • {"type":"wrapper","func":"valueVarPropGet","values":[{"type":"string","value":""},{"type":"string","value":"any"}]}
  • {"type":"wrapper","func":"valueControlMessageValue"}
  • {"type":"wrapper","func":"valueObjGet","values":[{"type":"string","value":""},{"type":"string","value":""}]}
  • {"type":"wrapper","func":"valueSensingAnswer"}

9. True or False: This block can only be used on global variables. {"type":"wrapper","func":"valueVarPropGet","values":[{"type":"string","value":""},{"type":"string","value":"any"}]}

  • True
  • False

10. True or false: If I change a global variable in one Actor's code, the value of that variable has been changed for all Actors.

  • True
  • False

11. True or false: If I change a local variable in one Actor's code, the value of that variable has been changed for all Actors.

  • True
  • False

U.S. Standards

  • CCSS-Math: 7.EE.B.4, MP.1, MP.2, MP.4, MP.7
  • 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-11, 2-AP-12, 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.12, 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 11: Receiving Values

Course: | Web

  • Concepts
  • Learn to Shoot
  • Hit the Enemy
  • Defeat the Robots
  • Create Your Own 2D Shooter
  • 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.