Middle School course

Programming 301

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

Answer Key

Module 2: Spooky Scene 1

Module 3: Spooky Scene 2

Module 4: Tear Down This Wall!

Module 5: Hide and Seek

Module 6: Quiz

1. What will this code block do? {"func":"registerSpriteTrigger","next":{"func":"blockMotionGoTo","values":[{"type":"number","value":"0"},{"type":"number","value":"0"}]}}

  • When the Actor is clicked, the Actor will appear in the middle of the screen
  • When the Actor is clicked, the Actor will appear on the right side of the screen
  • When the project plays, the Actor will appear in the middle of the screen
  • When the project plays, the Actor will appear on the right side of the screen

2. What will this code block do? {"func":"registerSpriteTrigger","next":{"func":"blockLooksHide"}}

  • When the Actor is clicked, the Actor will disappear from the screen
  • When the Actor is clicked, the Actor will appear in the middle of the screen
  • When the Actor is clicked, the Actor will play a sound
  • When the Actor is clicked, the Actor will appear on the screen

3. Annie was working on a game where she hides her Actors when she clicks on them. When she tried playing the game again, the Actors were still hidden. What can she add to fix this?

  • She should use {"func":"registerFlagTrigger","next":{"func":"blockLooksShow"}}
  • She should use {"func":"registerFlagTrigger","next":{"func":"blockMotionGoTo","values":[{"type":"number","value":"0"},{"type":"number","value":"0"}]}}
  • She should use {"func":"registerSpriteTrigger","next":{"func":"blockLooksShow"}}
  • She should use {"func":"registerSpriteTrigger","next":{"func":"blockMotionGoTo","values":[{"type":"number","value":"0"},{"type":"number","value":"0"}]}}

4. Ben is programming a game where monsters show up in a random position on the stage. What can he add to each monster's code so that they appear in different locations each time the game is played?

  • {"func":"registerFlagTrigger","next":{"func":"blockMotionGoTo","values":[{"type":"wrapper","func":"valueOpRandom","values":[{"type":"number","value":"300"},{"type":"number","value":"300"}]},{"type":"wrapper","func":"valueOpRandom","values":[{"type":"number","value":"-200"},{"type":"number","value":"200"}]}]}}
  • {"func":"registerFlagTrigger","next":{"func":"blockLooksHide"}}
  • {"func":"registerFlagTrigger","next":{"func":"blockMotionGoTo","values":[{"type":"number","value":"0"},{"type":"number","value":"0"}]}}
  • {"func":"registerFlagTrigger","next":{"func":"blockLooksNextCostume"}}

5. True or false: The value of the Point in Direction block will affect where the Actor ends up in this code block: {"func":"blockMotionPointDirection","values":[{"type":"string","value":"90"}],"next":{"func":"blockMotionMove","values":[{"type":"number","value":"10"}]}}

  • True
  • False

6. True or false: The value of the Point in Direction block will affect where the Actor ends up in this code block: {"func":"blockMotionPointDirection","values":[{"type":"string","value":"90"}],"next":{"func":"blockMotionGoTo","values":[{"type":"number","value":"100"},{"type":"number","value":"-200"}]}}

  • True
  • False

7. Daniel added background music to his game, but it stops after playing once. He wants it to loop for the entire game. How can he fix this?

  • He should put the Play Sound block in a Forever loop, like this: {"func":"registerFlagTrigger","next":{"func":"blockControlForever","containers":[{"func":"blockSoundPlay","values":[{"type":"string","value":"bg music"}]}]}}
  • He should put the Play Sound block in a Repeat loop, like this: {"func":"registerFlagTrigger","next":{"func":"blockControlRepeat","values":[{"type":"number","value":"10"}],"containers":[{"func":"blockSoundPlay","values":[{"type":"string","value":"bg music"}]}]}}
  • He needs to add the sound to the Stage, and it should automatically loop forever
  • He should put the Play Sound block under a When Actor Clicked block, like this {"func":"registerSpriteTrigger","next":{"func":"blockSoundPlay","values":[{"type":"string","value":"bg music"}]}}

8. Ellie wants to program a ghost to say "Boo!" a random number of times when the player clicks on him. Which code blocks will help her do that?

  • {"func":"registerSpriteTrigger","next":{"func":"blockControlRepeat","values":[{"type":"wrapper","func":"valueOpRandom","values":[{"type":"number","value":"1"},{"type":"number","value":"5"}]}],"containers":[{"func":"blockLooksSayFor","values":[{"type":"string","value":"Boo!"},{"type":"number","value":"1"}],"next":{"func":"blockControlWait","values":[{"type":"number","value":".1"}]}}]}}
  • {"func":"registerSpriteTrigger","next":{"func":"blockControlRepeat","values":[{"type":"number","value":"5"}],"containers":[{"func":"blockLooksSayFor","values":[{"type":"string","value":"Boo!"},{"type":"wrapper","func":"valueOpRandom","values":[{"type":"number","value":"1"},{"type":"number","value":"5"}]}],"next":{"func":"blockControlWait","values":[{"type":"number","value":".1"}]}}]}}
  • {"func":"registerSpriteTrigger","next":{"func":"blockControlRepeat","values":[{"type":"number","value":"5"}],"containers":[{"func":"blockLooksSayFor","values":[{"type":"string","value":"Boo!"},{"type":"number","value":"1"}],"next":{"func":"blockControlWait","values":[{"type":"number","value":".1"}]}}]}}
  • {"func":"registerSpriteTrigger","next":{"func":"blockControlRepeat","values":[{"type":"number","value":"5"}],"containers":[{"func":"blockLooksSayFor","values":[{"type":"string","value":"Boo!"},{"type":"number","value":"1"}],"next":{"func":"blockControlWait","values":[{"type":"wrapper","func":"valueOpRandom","values":[{"type":"number","value":"1"},{"type":"number","value":"5"}]}]}}]}}

9. True or false: You can pick random negative numbers.

  • True
  • False

10. Richard is trying to make the Actor disappear. Which block will make the Actor disappear from the screen?

  • {"func":"blockLooksHide"}
  • {"func":"blockLooksShow"}
  • {"func":"blockControlForever","containers":[null]}
  • {"type":"wrapper","func":"valueSensingTouchingColor","values":[{"type":"color","value":"#00ff00"}]}

11. Frank is trying to spawn zombies from the center of the Stage. Which of these blocks should he use?

  • {"func":"blockMotionGoTo","values":[{"type":"number","value":"0"},{"type":"number","value":"0"}]}
  • {"func":"blockMotionMove","values":[{"type":"number","value":"10"}]}
  • {"func":"blockMotionPointDirection","values":[{"type":"string","value":"90"}]}
  • {"func":"blockMotionGoTowards","values":[{"type":"string","value":"mouse-pointer"}]}

12. Gabe is trying to teleport a character from a portal Actor on one side of the screen to a portal Actor on the other side of the screen. What would be the easiest block to use for this task?

  • {"func":"blockMotionGoTo","values":[{"type":"number","value":"0"},{"type":"number","value":"0"}]}
  • {"func":"blockMotionGoTowards","values":[{"type":"string","value":"portal2"}]}
  • {"func":"blockMotionMove","values":[{"type":"number","value":"10"}]}
  • {"func":"blockMotionGoTowards","values":[{"type":"string","value":"mouse-pointer"}]}

13. What would this code block do to an Actor? {"func":"registerSpriteTrigger","next":{"func":"blockMotionGoTo","values":[{"type":"wrapper","func":"valueOpRandom","values":[{"type":"number","value":"-100"},{"type":"number","value":"110"}]},{"type":"wrapper","func":"valueOpRandom","values":[{"type":"number","value":"-100"},{"type":"number","value":"100"}]}]}}

  • It would send the Actor to a random position when the Actor was clicked
  • It would send the Actor to a random position when the program was started
  • It would send the Actor to the center of the screen when the Actor was clicked
  • It would send the Actor to the center of the screen when the program was started

14. True or false: It is not possible to show an Actor again after hiding it.

  • True
  • False

15. What does this code block do when it is run? {"func":"blockMotionPointDirection","values":[{"type":"string","value":"90"}],"next":{"func":"blockMotionMove","values":[{"type":"number","value":"10"}],"next":{"func":"blockMotionPointDirection","values":[{"type":"string","value":"-90"}],"next":{"func":"blockMotionMove","values":[{"type":"number","value":"10"}]}}}}

  • It would move the Actor to the right and back to where it started
  • It would move the Actor right twice
  • It would move the Actor left twice
  • It would move the Actor to the left and back to where it started

U.S. Standards

  • CCSS-Math: 6.NS.C.6, MP.1
  • 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-13, 2-AP-15, 2-AP-16, 2-AP-17
  • CS CA: 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 3: Actor Positioning

Course: | Web

  • Concepts
  • Spooky Scene 1
  • Spooky Scene 2
  • Tear Down This Wall!
  • Hide and Seek
  • 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.