Middle School course

Programming 301

  • GRADES 7-8
  • BEGINNER
  • WEB
  • 17 LESSONS
Slide: 1 of 19

Answer Key

Module 2: Clone Projectiles

Module 3: Clone Enemies

Module 4: Helicopter Dogfight

Module 5: Create an Attacker Game

Module 6: 2-Player Battle

Module 7: Quiz

1. Which code block is used to create clones?

  • {"func":"blockControlCloneActor","values":[{"type":"string","value":"self"}]}
  • {"type":"wrapper","func":"valueControlIsClone"}
  • {"func":"blockControlDeleteActor"}
  • {"func":"registerCloned"}

2. Which block is used to delete clones?

  • {"func":"blockControlCloneActor","values":[{"type":"string","value":"self"}]}
  • {"type":"wrapper","func":"valueControlIsClone"}
  • {"func":"blockControlDeleteActor"}
  • {"func":"registerCloned"}

3. Which block can I use to check if the enemy plane is touching one of the fireball clones?

  • {"type":"wrapper","func":"valueSensingTouchingCloneOf","values":[{"type":"string","value":"fireball"}]}
  • {"type":"wrapper","func":"valueSensingTouchingCloneOf","values":[{"type":"string","value":"WWI Plane"}]}
  • {"type":"wrapper","func":"valueSensingTouchingSprite","values":[{"type":"string","value":"fireball"}]}
  • {"type":"wrapper","func":"valueSensingTouchingSprite","values":[{"type":"string","value":"WWI Plane"}]}

4. What's the difference between these two blocks? {"func":"registerCloned"}{"func":"registerFlagTrigger"}

  • On Start runs at the start of the project and affects the original Actor. Clone Startup runs when a new clone is created and affects the new clones.
  • Clone Startup runs at the start of the project and affects the original Actor. On Start runs when a new clone is created and affects the new clones.
  • There is no difference. Both code blocks affect both the original Actor as well as the new clones.
  • On Start runs at the start of the project and affects the original Actor. Clone Startup runs at the start of the project and affects both the original Actor and the new clones.

5. Emma is programming the fireballs for her dragon. When the player presses the spacebar, a fireball clone should shoot from the dragon toward the right. What code blocks should she add to the fireball?

  • {"func":"registerCloned","next":{"func":"blockLooksShow","next":{"func":"blockControlForever","containers":[{"func":"blockMotionMove","values":[{"type":"number","value":"10"}],"next":{"func":"blockControlWait","values":[{"type":"number","value":".5"}],"next":{"func":"blockControlIf","values":[{"type":"wrapper","func":"valueOpGreater","values":[{"type":"wrapper","func":"valueMotionXPosition"},{"type":"wrapper","func":"valueOpAdd","values":[{"type":"wrapper","func":"valueSensingScreenRight"},{"type":"number","value":"20"}]}]}],"containers":[{"func":"blockControlDeleteActor"}]}}}]}}}
  • {"func":"registerCloned","next":{"func":"blockLooksShow","next":{"func":"blockControlForever","containers":[{"func":"blockMotionMove","values":[{"type":"number","value":"10"}],"next":{"func":"blockControlWait","values":[{"type":"number","value":".5"}],"next":{"func":"blockControlIf","values":[{"type":"wrapper","func":"valueOpGreater","values":[{"type":"wrapper","func":"valueMotionXPosition"},{"type":"wrapper","func":"valueOpAdd","values":[{"type":"wrapper","func":"valueSensingScreenLeft"},{"type":"number","value":"20"}]}]}],"containers":[{"func":"blockControlDeleteActor"}]}}}]}}}
  • {"func":"registerCloned","next":{"func":"blockMotionPointDirection","values":[{"type":"string","value":"-90"}],"next":{"func":"blockControlForever","containers":[{"func":"blockMotionMove","values":[{"type":"number","value":"10"}],"next":{"func":"blockControlWait","values":[{"type":"number","value":".5"}],"next":{"func":"blockControlIf","values":[{"type":"wrapper","func":"valueOpGreater","values":[{"type":"wrapper","func":"valueMotionXPosition"},{"type":"wrapper","func":"valueSensingScreenLeft"}]}],"containers":[{"func":"blockControlDeleteActor"}]}}}]}}}
  • {"func":"registerFlagTrigger","next":{"func":"blockMotionPointDirection","values":[{"type":"string","value":"-90"}],"next":{"func":"blockControlForever","containers":[{"func":"blockMotionMove","values":[{"type":"number","value":"10"}],"next":{"func":"blockControlWait","values":[{"type":"number","value":".5"}],"next":{"func":"blockControlIf","values":[{"type":"wrapper","func":"valueOpGreater","values":[{"type":"wrapper","func":"valueMotionXPosition"},{"type":"wrapper","func":"valueSensingScreenLeft"}]}],"containers":[{"func":"blockControlDeleteActor"}]}}}]}}}

6. Which block is used to detect if the enemy plane is touching a clone of the fireball?

  • {"type":"wrapper","func":"valueSensingTouchingCloneOf","values":[{"type":"string","value":"WWI Plane"}]}
  • {"type":"wrapper","func":"valueSensingTouchingCloneOf","values":[{"type":"string","value":"fireball"}]}
  • {"type":"wrapper","func":"valueSensingTouchingSprite","values":[{"type":"string","value":"fireball"}]}
  • {"type":"wrapper","func":"valueSensingTouchingSprite","values":[{"type":"string","value":"WWI Plane"}]}

7. Which block is used to detect if the dragon is touching a clone of the enemy plane?

  • {"type":"wrapper","func":"valueSensingTouchingCloneOf","values":[{"type":"string","value":"WWI Plane"}]}
  • {"type":"wrapper","func":"valueSensingTouchingCloneOf","values":[{"type":"string","value":"fireball"}]}
  • {"type":"wrapper","func":"valueSensingTouchingSprite","values":[{"type":"string","value":"fireball"}]}
  • {"type":"wrapper","func":"valueSensingTouchingSprite","values":[{"type":"string","value":"WWI Plane"}]}

8. Which block is used to detect if the enemy plane is touching the fireball?

  • {"type":"wrapper","func":"valueSensingTouchingCloneOf","values":[{"type":"string","value":"WWI Plane"}]}
  • {"type":"wrapper","func":"valueSensingTouchingCloneOf","values":[{"type":"string","value":"fireball"}]}
  • {"type":"wrapper","func":"valueSensingTouchingSprite","values":[{"type":"string","value":"fireball"}]}
  • {"type":"wrapper","func":"valueSensingTouchingSprite","values":[{"type":"string","value":"WWI Plane"}]}

9. When is a clone deleted?

  • When you use the Delete This Clone block {"func":"blockControlDeleteActor"}
  • When you use the Hide block {"func":"blockLooksHide"}
  • When the clone goes off of the screen to the right
  • When the clone goes off of the screen to the left

10. Where should you put the code for a clone?

  • Under a Clone Startup block in the original Actor’s code {"func":"registerCloned"}
  • Under an On Start block in the original Actor’s code {"func":"registerFlagTrigger"}
  • Under an On Start block in the Stage’s code {"func":"registerFlagTrigger"}
  • Under a Clone Startup block in the Stage’s code {"func":"registerCloned"}

11. True or false: Having too many undeleted clones can slow down your project. It’s good practice to add a Delete This Clone block somewhere under Clone Startup. {"func":"blockControlDeleteActor"}

  • True
  • False

12. True or false: You can create clones of any of the Actors on the Stage.

  • True
  • False

13. True or false: The Clone Startup block affects the original Actor. {"func":"registerCloned"}

  • True
  • False

14. True or false: The Clone Startup block affects all new clones that are created.

  • True
  • False

15. True or false: If the original Actor was hidden right before it was cloned, the resulting clones will also be hidden until we add a Show block.

  • True
  • False

U.S. Standards

  • CCSS-Math: MP.1, MP.4, MP.7
  • CCSS-ELA: RI.7.4, RI.8.4, 6-8.RST.3, 6-8.RST.4, 6-8.RST.7
  • CSTA: 2-AP-10, 2-AP-12, 2-AP-13, 2-AP-15, 2-AP-16, 2-AP-17
  • CS CA: 6-8.AP.12, 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 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 13: Cloning

Course: | Web

  • Concepts
  • Clone Projectiles
  • Clone Enemies
  • Helicopter Dogfight
  • Create an Attacker Game
  • 2-Player Battle
  • Quiz

Description

An advanced introduction to programming for middle school. Introduce programming fundamentals to your class as they build two arcade-inspired games from start to finish. The Adventure Game features a knight who has to defeat enemies to reach treasure. Students program arrow keys, fluid motion, hero and enemy behavior, and winning conditions. In Dragon Attack, they define multiple levels and lives, and program a boss enemy, while learning about variables and cloning.

Topics

  • Events
  • Keyboard and mouse interaction
  • Conditional loops
  • Nested loops
  • Sending and receiving messages
  • Fluid motion
  • Parallax scrolling
  • Local and global variables
  • Functions
  • Object cloning

What Students Learn

  • Build complex multi-level games
  • Use variables to keep score
  • Use cloning to create actors programmatically
  • Build algorithms using complex conditional logic
  • Understand parallelism with multiple scripts
  • Program different behaviors for different actors
  • Publish projects to the Web
  • Troubleshoot and debug programs

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.