Elementary School course

Programming 102

  • GRADES 3-4
  • INTERMEDIATE
  • WEB IPAD
  • 16 LESSONS
Slide: 1 of 18

Answer Key

Module 4: 2 Player Cannon Game 1

Module 5: 2 Player Cannon Game 2

Module 6: Destroy the Enemy Tanks

Module 7: Quiz

1. Which of these code blocks is considered a loop?

  • {"func":"blockControlForever","containers":[null]}
  • {"func":"blockSoundPlay","values":[{"type":"string","value":""}]}
  • {"func":"blockControlWait","values":[{"type":"number","value":"1"}]}
  • {"func":"blockLooksSwitchCostume","values":[{"type":"string","value":""}]}

2. What do these code blocks do to an Actor? {"func":"registerFlagTrigger","next":{"func":"blockLooksShow","next":{"func":"blockControlWaitUntil","values":[{"type":"wrapper","func":"valueSensingTouchingSprite","values":[{"type":"string","value":"knight"}]}],"next":{"func":"blockLooksHide"}}}}

  • If the knight touches the Actor, the Actor will disappear
  • If the knight touches the Actor, the knight will disappear
  • When the Play button is pressed, the Actor will show for a second or two before hiding
  • When the Play button is pressed, the Actor will disappear, then reappear when the knight touches the Actor

3. What do these code blocks do to an Actor? {"func":"registerFlagTrigger","next":{"func":"blockControlWaitUntil","values":[{"type":"wrapper","func":"valueSensingTouchingSprite","values":[{"type":"string","value":"knight"}]}],"next":{"func":"blockControlForever","containers":[{"func":"blockMotionGoTo","values":[{"type":"wrapper","func":"valueSensingSpriteProperty","values":[{"type":"choice","value":"x position"},{"type":"string","value":"knight"}]},{"type":"wrapper","func":"valueOpAdd","values":[{"type":"wrapper","func":"valueSensingSpriteProperty","values":[{"type":"choice","value":"y position"},{"type":"string","value":"knight"}]},{"type":"number","value":"200"}]}]}]}}}

  • When the knight touches the Actor, the Actor will follow the knight around, hovering over the knight's head
  • When the knight touches the Actor, the Actor will follow the knight around, following behind the knight
  • When the knight touches the Actor, the knight will follow the Actor around, hovering over the Actor
  • When the knight touches the Actor, the knight will follow the Actor around, following behind the Actor

4. Laura wants to program a gem that the valkyrie can collect. When the valkyrie picks up the gem, it'll appear in the upper left corner of the screen. Which of these code blocks would help her program the gem?

  • {"func":"registerFlagTrigger","next":{"func":"blockControlWaitUntil","values":[{"type":"wrapper","func":"valueSensingTouchingSprite","values":[{"type":"string","value":"valkyrie"}]}],"next":{"func":"blockMotionGoTo","values":[{"type":"number","value":"-500"},{"type":"number","value":"300"}]}}}
  • {"func":"registerFlagTrigger","next":{"func":"blockControlWaitUntil","values":[{"type":"wrapper","func":"valueSensingTouchingSprite","values":[{"type":"string","value":"gem"}]}],"next":{"func":"blockMotionGoTo","values":[{"type":"number","value":"-500"},{"type":"number","value":"300"}]}}}
  • {"func":"registerFlagTrigger","next":{"func":"blockControlWaitUntil","values":[{"type":"wrapper","func":"valueSensingTouchingSprite","values":[{"type":"string","value":"valkyrie"}]}],"next":{"func":"blockMotionGoTo","values":[{"type":"number","value":"-500"},{"type":"number","value":"-300"}]}}}
  • {"func":"registerFlagTrigger","next":{"func":"blockControlWaitUntil","values":[{"type":"wrapper","func":"valueSensingTouchingSprite","values":[{"type":"string","value":"valkyrie"}]}],"next":{"func":"blockLooksHide"}}}

5. Frank is creating an animation where his characters are in a relay race. When one runner reaches the next, she passes the baton to the second runner. What code blocks can Frank use to program runner2 to make sure that runner2 doesn't start until runner1 reaches her?

  • {"func":"blockControlWaitUntil","values":[{"type":"wrapper","func":"valueSensingTouchingSprite","values":[{"type":"string","value":"runner1"}]}]}
  • {"func":"blockControlWaitUntil","values":[{"type":"wrapper","func":"valueSensingTouchingSprite","values":[{"type":"string","value":"runner2"}]}]}
  • {"func":"blockControlWait","values":[{"type":"number","value":"1"}]}
  • {"func":"blockLooksSwitchCostume","values":[{"type":"string","value":"runner1"}]}

6. Joseph wants to program the gem to hide when the knight collects it. Which code blocks will help him do that?

  • {"func":"registerFlagTrigger","next":{"func":"blockLooksShow","next":{"func":"blockControlWaitUntil","values":[{"type":"wrapper","func":"valueSensingTouchingSprite","values":[{"type":"string","value":"knight"}]}],"next":{"func":"blockLooksHide"}}}}
  • {"func":"registerFlagTrigger","next":{"func":"blockLooksShow","next":{"func":"blockControlWaitUntil","values":[{"type":"wrapper","func":"valueSensingTouchingSprite","values":[{"type":"string","value":"mouse-pointer"}]}],"next":{"func":"blockLooksHide"}}}}
  • {"func":"registerFlagTrigger","next":{"func":"blockLooksShow","next":{"func":"blockControlWaitUntil","values":[{"type":"wrapper","func":"valueSensingTouchingSprite","values":[{"type":"string","value":"edge"}]}],"next":{"func":"blockLooksHide"}}}}
  • {"func":"registerFlagTrigger","next":{"func":"blockLooksShow","next":{"func":"blockControlWait","values":[{"type":"number","value":"1"}],"next":{"func":"blockControlIf","values":[{"type":"wrapper","func":"valueSensingTouchingSprite","values":[{"type":"string","value":"knight"}]}],"containers":[{"func":"blockLooksHide"}]}}}}

7. Which of these code blocks contains a nested loop?

  • {"func":"registerFlagTrigger","next":{"func":"blockControlForever","containers":[{"func":"blockControlRepeat","values":[{"type":"number","value":"10"}],"containers":[{"func":"blockSoundPlay","values":[{"type":"string","value":"beep"}]}]}]}}
  • {"func":"registerFlagTrigger","next":{"func":"blockControlForever","containers":[{"func":"blockControlIf","values":[{"type":"wrapper","func":"valueSensingKeyPressed","values":[{"type":"choice","value":"up arrow"}]}],"containers":[{"func":"blockSoundPlay","values":[{"type":"string","value":"beep"}]}]}]}}
  • {"func":"registerKeyTrigger","values":[{"type":"choice","value":"up arrow"}],"next":{"func":"blockSoundPlay","values":[{"type":"string","value":"beep"}]}}
  • {"func":"registerSpriteTrigger","next":{"func":"blockSoundPlay","values":[{"type":"string","value":"beep"}]}}

8. What would happen if you removed the {"func":"blockControlWaitUntil","values":[{"type":"wrapper","func":"valueSensingKeyPressed","values":[{"type":"choice","value":"space"}]}]} block from this code block?{"func":"registerFlagTrigger","next":{"func":"blockControlWaitUntil","values":[{"type":"wrapper","func":"valueSensingKeyPressed","values":[{"type":"choice","value":"space"}]}],"next":{"func":"blockLooksNextCostume"}}}

  • The Actor would change Costumes as soon as the program started
  • The Actor would change Costumes when space was pressed
  • The Actor would change Costumes when the mouse was clicked
  • The Actor would never change Costumes

9. What is the difference between the {"func":"blockControlWait","values":[{"type":"number","value":""}]} and {"func":"blockControlWaitUntil","values":[{"type":"boolean","value":""}]} blocks?

  • The {"func":"blockControlWait","values":[{"type":"number","value":""}]} block waits for a specified amount of time, while the {"func":"blockControlWaitUntil","values":[{"type":"boolean","value":""}]} block waits for a condition to be fulfilled.
  • The {"func":"blockControlWait","values":[{"type":"number","value":""}]} block waits for a condition to be fulfilled, while the {"func":"blockControlWaitUntil","values":[{"type":"boolean","value":""}]} block waits for a specified amount of time.
  • The {"func":"blockControlWait","values":[{"type":"number","value":""}]} and {"func":"blockControlWaitUntil","values":[{"type":"boolean","value":""}]} blocks both wait for a condition to be fulfilled.
  • The {"func":"blockControlWait","values":[{"type":"number","value":""}]} and {"func":"blockControlWaitUntil","values":[{"type":"boolean","value":""}]} blocks both wait for a specified amount of time.

10. What would you need to do to play a sound using this code block? {"func":"registerFlagTrigger","next":{"func":"blockControlWaitUntil","values":[{"type":"wrapper","func":"valueSensingKeyPressed","values":[{"type":"choice","value":"space"}]}],"next":{"func":"blockControlWaitUntil","values":[{"type":"wrapper","func":"valueSensingKeyPressed","values":[{"type":"choice","value":"space"}]}],"next":{"func":"blockControlWaitUntil","values":[{"type":"wrapper","func":"valueSensingKeyPressed","values":[{"type":"choice","value":"space"}]}],"next":{"func":"blockSoundPlay","values":[{"type":"string","value":"beep"}]}}}}}

  • You would need to press space three times
  • You would need to press space once
  • You would need to click with the mouse once
  • You would need to press the up arrow key

11. What makes up a nested loop?

  • At least one loop inside of another loop
  • One loop placed after another loop
  • At least one If statement inside of a loop
  • At least one Wait statement inside of a loop

12. True or False: This code block is a nested loop. {"func":"registerFlagTrigger","next":{"func":"blockControlRepeat","values":[{"type":"number","value":"10"}],"containers":[{"func":"blockMotionMove","values":[{"type":"number","value":"10"}]}],"next":{"func":"blockControlForever","containers":[{"func":"blockLooksNextCostume"}]}}}

  • True
  • False

13. True or False: This code block plays the sound every time space is pressed. {"func":"registerFlagTrigger","next":{"func":"blockControlWaitUntil","values":[{"type":"wrapper","func":"valueSensingKeyPressed","values":[{"type":"choice","value":"space"}]}],"next":{"func":"blockSoundPlay","values":[{"type":"string","value":"beep"}]}}}

  • True
  • False

14. True or False: You can have multiple loops inside one another.

  • True
  • False

15. True or False: You can only use nested loops once.

  • True
  • False

16. What would happen if you removed the {"func":"blockControlWaitUntil","values":[{"type":"wrapper","func":"valueSensingMouseDown"}]} block from this code block?{"func":"registerFlagTrigger","next":{"func":"blockControlWaitUntil","values":[{"type":"wrapper","func":"valueSensingMouseDown"}],"next":{"func":"blockLooksNextCostume"}}}

  • The Actor would change Costumes as soon as the program started
  • The Actor would change Costumes when the device was tilted forward
  • The Actor would change Costumes when the screen was touched
  • The Actor would never change Costumes

17. True or False: This code block plays the sound every time the screen is touched. {"func":"registerFlagTrigger","next":{"func":"blockControlWaitUntil","values":[{"type":"wrapper","func":"valueSensingMouseDown"}],"next":{"func":"blockSoundPlay","values":[{"type":"string","value":"beep"}]}}}

  • True
  • False

U.S. Standards

  • CCSS-Math: 3.NBT.A.2, MP.1
  • CCSS-ELA: RF.3.4.A, RF.4.4.A
  • CSTA: 1B-AP-10, 1B-AP-11, 1B-AP-12, 1B-AP-13, 1B-AP-15
  • CS CA: 3-5.AP.13, 3-5.AP.14, 3-5.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

Lesson 14: 2-Player Battle

Course: | iPad Web

  • Introduction
  • Concepts
  • 2 Player Cannon Game Example
  • 2 Player Cannon Game 1
  • 2 Player Cannon Game 2
  • Destroy the Enemy Tanks
  • Quiz

Description

Advance your class to intermediate level programming concepts using a wider set of visual blocks. In Snowball Siege, students learn about layering, Actor visibiliy, motion, and collisions. Then, in Star Runner, they use line drawing commands and program math art. They build several mini-games while understanding how to create more complex programs. After completing this lesson plan, students will be able to build a wide variety of school projects and their own comprehensive games.

Topics

  • Animation sequences
  • Motion
  • Game design basics
  • Built-in animation commands
  • Advanced keyboard and mouse control
  • Sending and receiving messages
  • Actor layering
  • Advanced events
  • Math operators
  • Functions

What Students Learn

  • Gain confidence in building a variety of programs
  • Apply programming concepts to build your own games
  • Design characters with multiple animation sequences
  • Write interactive stories with multiple scenes
  • Make an image editor using drawing primitives
  • Define more advanced keyboard and mouse interaction
  • Program special effects and explosions
  • 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.
* Tablet courses require an iPad (iOS 10+) with Tynker or Tynker Junior app installed and Internet access