TechnoCode Workbook Scratch 3 PDF
Document Details
Uploaded by FormidableTulsa2552
Tags
Summary
This document contains programming instructions for the Scratch 3 platform. "Session 4" is the current focus, with "Assignment 21 Direct the Timing of Events using Broadcast" outlining the use of broadcasting messages for controlling events within Scratch 3 projects.
Full Transcript
Session 4 Assignment 21 Direct the Timing of Events using Broadcast In this assignment, you will discover another way to direct the timing of events – broadcasting. Broadcasting sends a message to sprites. The message is used to trigger a script to run....
Session 4 Assignment 21 Direct the Timing of Events using Broadcast In this assignment, you will discover another way to direct the timing of events – broadcasting. Broadcasting sends a message to sprites. The message is used to trigger a script to run. Did I just receive the message warning? Yes! I am now going to say, Do not touch that! Plan to Broadcast Messages Broadcast messages from the character to other sprites: Send messages to the object to control when it is in view. Send messages to a friend to have them speak. Open the saved story project in Scratch. Study the character's script. You will add broadcast blocks to it. For example: 1. The object will be hidden at the start of the story. Where should the go in the character's script? at the start of the script at the end of the script 2. A block will direct when the object is in view. When should the message be sent to show the object? Above the block. 3. A block will be used to time when a friend says a warning. When should the message be sent? Above the block. 4. Broadcasting will be used to have the object AND friend do an action when the character starts to change how they look. When should the message be sent? Above the block. Copyright © TechnoKids Inc. 86 TechnoCode | Scratch 3 Session 4 Broadcast a Message to Hide an Object Use broadcasting to hide the object at the start of the story. Later, you will cause it to show at just the right time! Select the character sprite. From the Events palette, add the block: Click the arrow. Select New message. Type hide. Click OK. It is a good idea to give a broadcast message the name of the action it will trigger. This makes it easy to identify. Place the broadcast block at the start of the story. Receive a Message that Triggers the Object to Hide Select the object sprite. Build a script to hide the object. Use the tips to find each block: Events Looks Click the character sprite on the stage to play the story. The object needs to show when the character notices it. You need another broadcast block. Copyright © TechnoKids Inc. 87 TechnoCode | Scratch 3 Session 4 Show an Object using Broadcasting Select the character sprite. Send a message to the object to show: o From the Events palette, add. o Click the arrow. Select New message. o Type show. Click OK. o Place the broadcast block into the script. For example: Timing is everything! When should the object appear? Select the object sprite. Build a script to show the object. Use the tips to find each block: Events Looks Click the character sprite to play the story. Broadcast a Message and then Wait for a Friend to Say Something Select the character sprite. Send a message to a friend to have them say a warning: o From the Events palette, add. o Click the arrow. Select New message. o Type warning. Click OK. o Place the broadcast and wait block into the script. For example: The script will pause until all actions triggered by the message are done. Insert a friend. Select the friend sprite. Build a script to have the friend say a warning: Click the character sprite to play the story. Copyright © TechnoKids Inc. 88 TechnoCode | Scratch 3 Session 4 Broadcast a Message to More Than One Sprite Select the character sprite. Send a message to both the object and friend: o From the Events palette, add or. o Click the arrow. Select New message. o Type change look. Click OK. o Place the block into the script. For example: Broadcasting can be used to send a message to many sprites. Select the friend sprite. What will the friend say about what is happening? Select the object sprite. What will it do after the character touches it? move back and forth whirl spin around Click the character sprite to play the story. Take the Challenge Broadcast another message. Be creative! have the friend send a message to the object add a new sprite that sends a message Exit Scratch Copyright © TechnoKids Inc. 89 TechnoCode | Scratch 3 Session 4 Assignment 22 Complete the Story In this assignment, you get ready to share your story. Complete the checklist to make sure all the parts of the project are finished. If you have time, take one of the challenges. Story Checklist Open the saved story project in Scratch. Use the checklist to review the project. Do you need to make changes? ✓ The speech and think bubbles help to explain what is happening in the story. The backdrop at the start of the story illustrates the setting. Backdrop changes enhance storytelling. Costumes match story events. They are used to animate a character or show emotion. Events are well -timed using various coding methods (switch backdrop, broadcasting) Looks blocks are used to set the appearance of sprites. View the Story Project Page to Add Viewing Instructions Click See Project Page. Add instructions: o In the Instructions box explain how to watch the story. For example, Click the character to play the story. o In the Notes and Credits box give extra information. For example, This story is about the amazing things that happen in a magical place. If you want others to view your story, click Share. If not, click See inside. Copyright © TechnoKids Inc. 90 TechnoCode | Scratch 3 Session 4 Take the Challenge to Enhance the Story (Optional) Make your story even better! Use the suggestions of come up with your own ideas. Make a title backdrop: Open the Paint Editor: o From the right side of the Scratch window, click Backdrops. o Click the Backdrops tab. o Right click the backdrop used at the start of the story. Click duplicate. o Rename the backdrop title. Add a Story Title and viewer instructions. Look at the stage. Can you read the text or is a sprite blocking the words? Add a script to the character sprite that will show the title when the viewer clicks. Make an interactive story: Add sprites that when clicked do an action. To tell the viewer what to do, have a sprite say at the end of the story, click objects on the story page to see more strange things. Exit Scratch Copyright © TechnoKids Inc. 91 TechnoCode | Scratch 3 Session 4 Coding Journal: Story Reflection Answer the questions to write a coding journal entry about the story project. 1. What was your story about? 2. What is the favorite part of your story? 3. a. You used Looks coding blocks to change the appearance of the sprite and stage. Which block do you think made your story interesting to watch? Pick one. b. Why? Copyright © TechnoKids Inc. 92 TechnoCode | Scratch 3 Session 4 4. You had to know a lot about Scratch to make the story. What were some of your biggest challenges? Pick two. setting the sprite to change its look script was too long to fit on the screen remembering to pick the correct sprite when editing code placing the blocks in the right spot to time events editing the sprite or backdrop using the Paint Editor finding and fixing mistakes in the code understanding how broadcasting works other: 5. There are many strategies you can use to find and fix mistakes in the code. Check all the ones you used when making the story. run a script and then watch the stage to see when each coding block happens run only part of the script by temporarily detaching some of the blocks change the plan to come up with an idea that you know how to code edit only one thing at a time to try to find the problem ask a friend or the teacher for help delete the script and start over check for blocks that might be missing such as a forever or wait check for blocks used to set the starting point of a sprite that might be missing check for blocks used to set the starting look of a sprite that might be missing other: 6. A programmer cannot give up when coding becomes difficult. Sticking to a task is called persistence. You are persistent! You never quit. Instead, you finished the story. What did you do or say to yourself to keep working? Copyright © TechnoKids Inc. 93 TechnoCode | Scratch 3 Session 4 Session 4 Review: About Looks Blocks and Timing of Events Change the Look of the Sprite Pick the correct block. 1. You want the shape of the sprite to distort. Which block should you use? a. b. c. 2. You want the sprite to shrink in size. Which block should you use? a. b. c. 3. You want to remove effects from a sprite. Which block should you use? a. b. c. /3 Complete the Script Each script is missing a block. Pick the correct block that will make the script work. 4. Animate the sprite to make it look like it is moving. Which block does the script need? a. b. c. 5. Change the backdrop to set the scene of a story. Which block does the script need? a. b. c. /2 Copyright © TechnoKids Inc. 94 TechnoCode | Scratch 3 Session 4 Time the Sequence of Events There are many different ways to time events. Pick the correct block to complete the action. 6. Send a message to other sprites to direct when actions happen. Which block should you use? a. b. c. 7. Run a script when a change in backdrop happens. Which block should you use? a. b. c. 8. Run a script when a message is received from a sprite. Which block should you use? a. b. c. /3 Debug the Script Find and fix the mistake. 8. The script should send a message to a sprite to trigger an action to happen at the same time. Circle the block that is incorrect in the sprite's script that is sending the broadcast. 9. Select the correct block to fix the script. a. b. c. /2 TOTAL /10 Copyright © TechnoKids Inc. 95 TechnoCode | Scratch 3 Session 4 Session 4 Skill Review: Build an Interactive Diorama In this session you learned about Looks blocks. Apply your knowledge to design a diorama. A diorama is a display that has objects in it that show a scene from nature or historical event. Your diorama will be interactive. The viewer To see what you will be able to click on an object to learn more or see an animation. can make, watch the diorama videos. To gain ideas, search the Scratch Library to pick a backdrop and sprites for your diorama. If you cannot find what you need, gather resources from the Internet. Before saving a file, make sure you are permitted to use it. A website with free photos and clip art is Pixabay - https://pixabay.com/en/. Prepare to Build a Diorama 1. Pick a topic from the list or think of your own idea. At the Farm Arctic Animals Discover the Wetlands Jurassic Park Medieval Times Forest Friends Fun at School Under the Sea Lunar Landing my idea: 2. The diorama will have a backdrop. Do you have what you need? Yes, I have picked a backdrop I like from the Scratch Library. Yes, I have saved a suitable image from the Internet that I will use as a backdrop. 3. The diorama will have at least three objects. Do you have what you need? Yes, I have at least three sprites picked out from the Scratch Library. Yes, I have saved three images from the Internet. Yes, I have picked sprites I like, plus I have saved images from the Internet. Build the Diorama 1. Open Scratch and start a new project. Save it as diorama. 2. Insert a Scratch backdrop or upload a saved backdrop file. 3. Insert each object: a. Insert a sprite or upload a saved image file. b. Resize the sprite. c. Delete Sprite 1. Sample Scene Copyright © TechnoKids Inc. 96 TechnoCode | Scratch 3 Session 4 4. Build a script for each object. When a viewer clicks on the object, it should say a fact or change appearance. Use the suggested scripts or come up with your own ideas. say a fact grow and shrink change costumes to animate apply an effect switch to a costume Change the look to suit the topic or fact. 5. Be creative! Make the diorama interesting to watch. Pick one or more challenges: Edit the backdrop. Add a title and viewing instructions. To keep the image clear, you may need to select Convert to Vector. Include a sound clip. Have the character move to show how it behaves or highlight a fact. Paint or upload a costume to illustrate a fact. Switch to it. 6. Add viewing instructions: a. Click See project page. b. In the Instructions box explain how to view the diorama. For example, Click each animal to learn why farming is important. c. In the Notes and Credits box add extra details. For example, Images are from Pixabay. 7. (Optional) Share the diorama. View classmates' projects. Answer Questions About the Diorama 1. Why is a diorama a fun way to share information with kids? 2. Which script in your diorama do you like the most? What does it do? Copyright © TechnoKids Inc. 97 TechnoCode | Scratch 3 Session 4 Session 4 Extension Activity: Edit the Object's Costumes Use the Paint Editor to customize the strange object in the story: change the color delete unwanted items add details bend the shape 1. Open the story project in Scratch. 2. Select the object sprite. 3. Click the Costumes tab. 4. Select part of the image to edit: a. Select a costume. b. Click Zoom In many times. c. Click part of the object. It might be grouped. If it is, click Ungroup. A part of a sprite cannot be edited if it is grouped. If the Fill and Outline have circles , the parts are grouped. 5. Use the Paint Editor tools to customize the look. Use these tips: Change the color: Edit the Fill or Outline. Delete unwanted items: Select a part and then press delete on the keyboard. Copy a color: Use Pick up color to select a color on the canvas. Add details: Draw lines or make shapes. 6. Create many costumes to show animation: a. Right click on a costume. Select duplicate. b. Bend the points to change the shape of the object. 7. When done, click the Code tab. 8. Add these coding blocks to animate the object. Copyright © TechnoKids Inc. 98 TechnoCode | Scratch 3 Session 4 Session 4 Extension Activity: Record a Sound Clip The short story you made is for young children. Some viewers may not be able to read the words on the screen. To solve this problem, you can record the text in the speech and think bubbles using a microphone. The sound clips can then be added to the script to have the story read aloud. Write the text from each speech and text bubble in the space below. Use them as a script when recording. 1. Open the story project in Scratch. 2. Select the character sprite. 3. Click the Sounds tab. 4. Hover over Choose a Sound. From the menu, click Record. 5. You may need to click Allow. 6. Click Record. Pretend you are the main character. Speak into the microphone. Say the text from the first speech bubble. 7. When finished, click Stop recording. Click Play to hear the recording. 8. If you like the recording, click Save. If not, click Re-record. 9. Rename the sound clip. 10. Click the Code tab. 11. Use your skills to add the recorded sound before the correct say block. For example: 12. Record the remaining sound clips for the character sprite. Add them to the story. 13. If you have another sprite that says or thinks something, select it. Record the clips. 14. Save the project and then exit Scratch. Copyright © TechnoKids Inc. 99 TechnoCode | Scratch 3 Session 4 Session 4 Extension Activity: Organize Scripts with Broadcast Long scripts can be difficult to debug. Often, the stack does not fit on the screen. This means you have to scroll up and down to see all the blocks. There is a solution! Broadcasting! Broadcasting can be used to have a sprite send a message to other sprites. When they receive the message, they run a script. This coding technique was used in Assignment 16 to direct the timing of events. You can also use broadcasting to have a sprite send a message to itself. This method can be used to divide a long script into smaller chunks. For example: Use a broadcast block to trigger The script can another script for the same sprite. be chunked into smaller parts using broadcast blocks. This technique cannot be used with broadcast and wait blocks. The character's script is long. Follow the instructions to divide the character's script into chunks using broadcasting. 1. Open story in Scratch. Rename the project, story organize. 2. Find the broadcast message, show, in the character's script. Drag the block below it to separate the script. Move it in the Scripts Area. 3. Add the block, to the top of the new chunk of script. 4. Find the broadcast message, change look, in the character's script. Drag the block below it to separate the script. Move it in the Scripts Area. 5. Add the block, to the top of the new chunk of script. 6. Divide the change look script even more! Find the blocks that show the story ending. Add before them. Separate the script. Top the new chunk with. 7. Save the project and then exit Scratch. Copyright © TechnoKids Inc. 100 TechnoCode | Scratch 3 Session 5 Engineer a Game In this session, students create their final project for the Activity Studio. They apply their coding skills to develop a game. To start, they use planning sheets to determine the objective, scoring system, timing, and coding structure. Next, they discuss their design with a partner to assess if it is suitable for young children. Afterwards, students follow instructions to build and test the code. Challenges are included to foster originality. Upon completion, the project is prepared for players. Students are then given the option to share the file with the Scratch community and classmates. Assignment 23: Develop a Game Assignment 24: Determine Coding Blocks for Game Design Assignment 25: Consult on Game Design Assignment 26: Build and Test the Game Assignment 27: Keep Score Assignment 28: Set a Time Limit Assignment 29: Game Over Assignment 30: Share the Game with Players Coding Journal: Game Reflection Session 5 Review: Operators, Conditions, and Variables Session 5 Skill Review: Develop a Treasure Hunt Session 5 Extension Activity: Chat with a Sprite Session 5 Assignment 23 Develop a Game You are going to build a game that has the player touch targets to score points. Answer the questions to plan your game. Prepare to Build a Game To see what you are going to make, watch the game video. What is the purpose of your game? Get your creativity flowing! Explore the Scratch Library to find backdrops and sprites. Looking for something different? Visit Pixabay to search for images: https://pixabay.com/en/. Plan the Game Design 1. Who do you know that would like to play a game? 2. Pick a plot for your game: Earth is under attack. Help save the planet from the aliens. Catch the baseballs to win the game. The farmer has lost his horses. Can you bring them home? The space pirate is hunting for treasure. Put the jewels in the chest. my idea: 3. Where does the game take place? Do you have what you need? Yes, I have picked a backdrop I like from the Scratch Library. Yes, I have saved a file from the Internet. I am permitted to reuse it. 4. What or who is the player? The mouse pointer will be an image of the player. Do you have what you need? Yes, I have picked a sprite I like from the Scratch Library. Yes, I have saved a file from the Internet. I am permitted to reuse it. 5. What or who is the target? Do you have what you need? Yes, I have picked a sprite I like from the Scratch Library. Yes, I have saved a file from the Internet. I am permitted to reuse it. Copyright © TechnoKids Inc. 103 TechnoCode | Scratch 3 Session 5 Assignment 24 Determine Coding Blocks for Game Design Answer the questions to think about the coding blocks needed to build the scripts. What Happens at the Start of the Game? 1. When Go is clicked the player will appear on the screen. What instructions should the player say? 2. The player must start in a specific spot. Which block do you need to use? a. b. 3. The target will be hidden until the game play begins. Which block do you need to use? a. b. What Happens During the Game? 4. In the game, the player moves the mouse to touch targets. The mouse pointer will be a sprite. Which block will cause a sprite to move with the mouse? a. b. 5. The target will appear when the game play begins. Which block do you need to use? a. b. 6. The target will show up in random spots. How should the target look to draw attention? say something change size switch costumes graphic effect 7. The game must keep showing targets. What control must go around the blocks to make the target's script run non-stop? a. b. 8. When will a sound play? when player introduces game when target is touched when game ends Copyright © TechnoKids Inc. 104 TechnoCode | Scratch 3 Session 5 Keep Score and Track Time 8. You will make a score variable that tracks the points earned by the player. The score will increase if a player touches a target. How many points is each target? Write the points in the block: 9. You will make a timer variable. It will track the amount of time a player plays the game. The timer will increase by 1 each time 1 second passes. This will be used to set a time limit. How many seconds should the game play? Write the time limit in the block: What Happens at the End of the Game? 11. How will you show that the game has ended? The player will: say GAME OVER switch backdrop to one that says GAME OVER 12. The target will be hidden at the end of the game. Which block do you need to use? a. b. How Will You Direct the Timing of Events? Broadcasting will trigger scripts to keep score, track time, move a target, and end the game. 13. will send a message to start the game. Which block does each sprite need, to receive the broadcast? a. b. 14. will send a message to end the game. Which block does each sprite need, to receive the broadcast? a. b. Copyright © TechnoKids Inc. 105 TechnoCode | Scratch 3 Session 5 Assignment 25 Consult on Game Design Pair up! Tell a friend about your game. Have them use the checklist to give you helpful feedback to make it even better! Use the suggestions to improve the game design. Name of Peer Consultant: Scratcher Profile Name: ✓ Is the game suitable for young children? Does the backdrop illustrate the setting of the game? Do the player and target match the plot of the game? Are the instructions for playing easy to understand? Will the target attract attention? Will sound add interest to the game? Will the player know when the game is over? Does the scoring system make sense? Is the time given to play the game ideal? Suggestions: Copyright © TechnoKids Inc. 106 TechnoCode | Scratch 3 Session 5 Assignment 26 Build and Test the Game It is time to start to build the game. You will add a player and targets. Refer to Assignment 24 to review your ideas. The target sprite will show up in random spots. It must be touched by the player sprite to score points. The player sprite will become the mouse pointer. Create a New Project and Save It Open Scratch and begin a new project. Save the project as game. Add a Backdrop for the Game Setting Click Choose a Backdrop to use an image from the Library. Or from the menu, click Upload to use a saved image file. Pick a setting for your game. Have the Player Explain How to Play the Game Delete Sprite1. Add a player sprite: o Click Choose a Sprite to use an image from the Library. o Click Upload to use a saved image file. Use your skills to rename and resize the sprite: Build a script to have the player start in a specific spot and explain how to play: You may want to play a sound when the game begins. Copyright © TechnoKids Inc. 107 TechnoCode | Scratch 3 Session 5 Control When the Player Turns into the Mouse Pointer Broadcasting sends a message to sprites. The message is used to trigger a script to run. You will use a play game broadcast to control when the player turns into the mouse pointer. Did I just receive a message from myself called play game? Yes! I am now going to become the mouse pointer. After the sprite explains how to play it is time to start the game. Select the player sprite. Send a play game broadcast: o From the Events palette add. o Click the arrow. Select New message. o Type play game. Click OK. o Place the broadcast block at the end of the script. Build a script to turn the player sprite into the mouse pointer: Forever will make the player go where the mouse pointer is moved. Non-stop! TIP: Add. Change it to mouse-pointer. Click Go. When the game starts, move the mouse. o Does the player sprite move with the mouse pointer? o Is the player sprite a suitable size? Click Stop. Copyright © TechnoKids Inc. 108 TechnoCode | Scratch 3 Session 5 Add a Target and Hide It Use your skills to add a target sprite. Rename the sprite target. Resize the sprite. Build a script to hide the target: Control When the Target Appears Use the play game broadcast to trigger when the target shows and what it looks like. Build this script: I just received the message play game. I am now going to show up in random spots and change how I look. What does the target look like to attract attention? Pick an idea or come up with your own: switch costumes change size say something apply effect Click Go. When done, slick Stop. o Does the target attract attention? o Is the timing of the target ideal? Copyright © TechnoKids Inc. 109 TechnoCode | Scratch 3 Session 5 Tips to Improve Game Play Are you having problems with your targets? Use these tips to make the game more fun to play: Target moves too fast: Add a wait block to keep it in the same spot longer. Target moves too slow: Adjust the timing of a block to less seconds. Target is too easy to touch: Make it smaller. Target is in view too long: Add hide , wait , and show blocks. Target is behind the player: Add go to front layer to the target sprite. Take the Challenge (Optional) Make your game even better! Use the suggestions of come up with your own ideas. Decorate the scene with sprites. Be creative! If you want to change the direction a sprite faces click the Costumes tab. Click Select and drag around the sprite to select all the parts. Click Flip Horizontal or Flip Vertical. Create an opening scene: Add sprites to make an animation that describes the plot of the game. Exit Scratch Copyright © TechnoKids Inc. 110 TechnoCode | Scratch 3 Session 5 Assignment 27 Keep Score A variable is a factor that can change. You will use a score variable to track the points earned by the player. At the start of the game the score will be 0. Each time the player touches a target the score will increase. Am I touching the target? YES Increase the score by 1 point. Keep Track of the Score Open the saved game project in Scratch. Select the player sprite. From the Variables palette, click. Type score as the variable name. Click OK. A variable should have a unique name to make it easy to identify. Select the score variable to display it. Use your skills to build this script: When the play game broadcast is received the player can start to score points. Drag into Click the arrow and select target. Set the number of points. Copyright © TechnoKids Inc. 111 TechnoCode | Scratch 3 Session 5 Test the Scoring System Play the game. When done, click Stop. o Does the score increase each time the target is touched? o Are too many points added when the player touches a target? Use these tips to improve how the player scores points: o Too many points are added when target touched: Add after change score. o Play a sound: Add. You may need to trim the clip. Set the Score to Zero When a New Game Begins Play the game again. Does the score start at zero? You must set the score to zero when a new game begins. Select the player sprite. From the Variables palette, add to the start of the player's script: Click the arrow and select score. Play the game again. Does the score start at zero? Get Creative or Exit Scratch Use your skills to Use your skills to add a second add an target. obstacle. Edit the script to Edit the script to keep track of have the player the score. lose points. Copyright © TechnoKids Inc. 112 TechnoCode | Scratch 3 Session 5 Assignment 28 Set a Time Limit You will make a timer variable that tracks the amount of time a player plays a game. At the start of the game the timer will be set to 0. The timer will increase by 1 each time a second passes. This will REPEAT UNTIL the timer equals a specific number of seconds. When this happens, the timer stops. The timer stops when it Does the timer equal 15? reaches the time limit. If NO: Wait 1 second. Increase the timer Repeat until… The timer equals 15. Create a Timer Variable Open the saved game project in Scratch. Select the player sprite. From the Variables palette, click. Type timer as the variable name. Click OK. Select the timer variable to display it. Use your skills to build this script: When the play game broadcast is received the timer starts. Drag into. Set the time limit. Add the variable. Set the timer to 1 second. Copyright © TechnoKids Inc. 113 TechnoCode | Scratch 3 Session 5 Test the Timer Play the game. o Does the timer increase when one second passes? o Does the timer stop when it reaches the time limit? Click Stop. Set the Timer to Zero When a New Game Begins Play the game again. Does the timer start at zero? You must set the timer to zero when a new game begins. Select the player sprite. From the Variables palette, add to the start of the player's script: Click the arrow and select timer. Play the game again. When done, click Stop. o Does the score start at zero? o Can the player keep scoring after the time limit is reached? Yes! This needs to be fixed. Fixing the Scoring Problem - Looking Ahead In the next assignment, you will stop the player from scoring when the game is over. Exit Scratch Copyright © TechnoKids Inc. 114 TechnoCode | Scratch 3 Session 5 Assignment 29 Game Over In this assignment, you set what happens when the game is over. The timer is used to create a time limit. When it is reached the game must stop. You will use broadcasting to control what happens. Follow the instructions to: tell the player that the game is over hide the target from view so that the player cannot keep scoring points When the time limit is reached a message is sent to end the game. Broadcast When the Game is Over Open the saved game project in Scratch. Select the player sprite. Send a game over broadcast: o From the Events palette add. o Click the arrow. Select New message. o Type game over. Click OK. o Place the broadcast block at the end of the timer script. Copyright © TechnoKids Inc. 115 TechnoCode | Scratch 3 Session 5 Tell the Player the Game is Over and Hide the Target Select the player sprite. Tell the player the game has ended. For example: say GAME OVER switch backdrops If you switch backdrops you will must set the backdrop at the start of the game. Select the target sprite. Build a script to hide the target: Play the game. Click Stop. o Does the player know the game has ended? o Can you see the target after the game is over? o Can the player keep scoring after the time limit is reached? Tips to Improve the Game Use these tips to make the end of the game more interesting: Add sound: Play a sound when the game ends. If you have problems put it below the game over broadcast block in the player's script. Move it: Have the player go to a specific spot when the game is over. Paint a backdrop: o Duplicate the game backdrop. Name it game over. o Use Text to add GAME OVER. o TIP: If switching backdrops, you must set the starting backdrop. Display a different message based on the score: o Select the player sprite. o Add if then else to the game over script. If the score is o Add to the if then block. greater than 10 say great work! o Drag into the operator. If the score is not o Set the greater than value to 10. greater than 10 say keep trying. o Say something IF score is greater than 10. o Say something ELSE if the score is not. Exit Scratch Copyright © TechnoKids Inc. 116 TechnoCode | Scratch 3 Session 5 Assignment 30 Share the Game with Players In this assignment, you get ready to share your final activity with players. Complete the checklist to make sure all the parts of the project are finished. If you missed anything, go back and edit the game project. Open the saved game project in Scratch. Use the checklist to review the project. Do you need to make changes? ✓ Game Design The game has a plot that is interesting to children. It is fun to play. The backdrop and sprites match the plot of the game. The instructions for playing are easy to understand. The target attracts attention when it is in view. The player can see their score and the time that has passed. The time limit for the game is ideal. The player is told when the game is over. Coding The player sprite moves with the mouse pointer. During the game, the target sprite moves to a random position. A score variable is used to track points earned from touching targets. The if then condition is used to increase the score each time a target is touched. A timer variable is used to track seconds of game play. The repeat until condition is used to set a time limit for the game. Broadcasting is used to direct the timing of when game play begins and when the game is over. Additional coding has been added to the game to make it unique. For example, sound highlights the action. Or, there is more than one target. Copyright © TechnoKids Inc. 117 TechnoCode | Scratch 3 Session 5 View the Game Project Page to Add Playing Instructions Click See project page. Add the instructions: o In the Instructions box explain how to play. For example, Alien Attack – Move the mouse to stop the aliens form invading Earth. o In the Notes and Credits box thank the consultant from Assignment 25 using their Scratcher Profile Name. If digital media was used from a website identify the source. For example, Thanks to TechnoMolly for giving me great advice that helped to make this game even better. Backdrop and some sprites are from Pixabay. If you do not want to share your project, click See inside. Share the Project with the Scratch Community (Optional) If you want others to play your game, click Share. Click Copy Link. Share the link with others. Play other friend's games. If available, write, read, and reply to comments. Exit Scratch Copyright © TechnoKids Inc. 118 TechnoCode | Scratch 3 Session 5 Coding Journal: Game Reflection Answer the questions to write a coding journal entry about the game project. 1. What is your game about? 2. What is your favorite thing about your game? 3. What part of the game was the most difficult to code? Why? 4. You have learned how to code a game that has the player move the mouse to touch targets. What other game could you make that uses this type of player control? Copyright © TechnoKids Inc. 119 TechnoCode | Scratch 3 Session 5 5. You designed a fun game for children to play. Rate how you feel about programming with Scratch. 1 2 3 4 5 I dislike it a lot. I do not like it. It is okay. I like it. I love it. 6. Look at the Coding Journal: Aquarium Reflection you did in Session 2. You rated how you felt about programming when you were starting to learn Scratch. Did your rating change? Why or why not? 7. You have learned lots about Scratch. Check the coding skills you can do on your own. run or stop a script make an action happen forever move a sprite use an if then condition set how a sprite looks use a repeat until condition insert a sound clip broadcast a message wait for an amount of time other: describe skill 8. Which coding skill do you want to learn about or practice more? 9. What advice would you give to someone just beginning to learn Scratch? Copyright © TechnoKids Inc. 120 TechnoCode | Scratch 3 Session 5 Session 5 Review: Operators, Conditions, and Variables About Operators 1. What will this operator do? a. report when the timer variable equals 15 b. make a timer variable c. report when the score variable equals 15 2. Which operator can be used to end a game when the score equals 25. a. b. c. /2 About Conditions Each script is missing a block. Pick the correct block that will make the script work. 3. Play a sound when the drum sprite is touched. Which block does the script need? a. b. c. 4. Score a point each time a sprite is touched. Which block does the script need? a. b. c. 5. Increase a timer by 1 second until a time limit is reached. Which block does the script need? a. b. c. /3 Copyright © TechnoKids Inc. 121 TechnoCode | Scratch 3 Session 5 About Variables 6. Which block will show the score variable to the player? a. b. c. 7. Which block will reset the timer variable to 0? a. b. c. 8. Which block will increase the score variable by 2? a. b. c. /3 Debug the Script 9. The player should be able to control the game with the mouse pointer. Circle the block that is incorrect. 10. Select the correct block to fix the script. a. b. c. /2 TOTAL: /10 Copyright © TechnoKids Inc. 122 TechnoCode | Scratch 3 Session 5 Session 5 Skill Review: Develop a Treasure Hunt In this session, you had fun making a game. Use your skills to design a simple treasure hunt for children ages 3-5. To see what you In the game the player must find an item hidden in a scene. are going to When they click on the correct item, they score a point. The make, watch the game will end when all the items are found. hunt video. Prepare to Build a Treasure Hunt 1. Pick a topic from the list or think of your own idea. Find the yellow balls. Put the farm animals in the barn. Help the mermaid find her jewels. Return the puppies to their mom. Catch the bugs and put them in a jar. Put the fruit in a bowl. my idea: 2. Who is the main character in the game? 3 Where does the game take place? 4. What is the item that must be found? 5. What other items can you include to mix up the player? Create the Scene 6. Open Scratch and start a new project. Save it as hunt. 7. Insert a Scratch backdrop or upload a saved backdrop file. 8. Insert the character: a. Insert a sprite or upload a saved image file. b. Rename it character. Resize the sprite. Hide the item in the scene. Add other 9. Insert the item: items that fit the scene to challenge a. Insert a sprite or upload a saved image file. the player. b. Rename it item. Resize the sprite. 10. Insert the other items. 11. Delete Sprite 1. Introduce the Game 12. Select the character sprite. Build a script to have the character say how to play. For example, It is time to bake an apple pie. Click on each apple to put it in the bowl. Entice a player to want to play. Pick an idea or think of your own idea. play a sound glide to a specific spot Copyright © TechnoKids Inc. 123 TechnoCode | Scratch 3 Session 5 Keep Score When the item sprite is clicked the player scores a point. Afterwards, it will disappear. 13. Create a score variable: a. Select the item sprite. b. From the Blocks palette, click Variables. Select Make a Variable. c. Type score as the variable name. Click OK. d. Select the score variable to display it on the stage. 14. Build a script to cause the item when clicked to score a point. After, it will hide. Does the item do something when clicked? Pick an idea or think of your own. go to a specific spot move to a sprite change color 15. Build a script to reset the score to zero and show all the items when a new game starts. Does the item do something at the start of the game to give the player a clue? Pick an idea or think of your own. grow and then shrink move right and left End the Game When all the items are found the game will end. 16. Duplicate the item to create more items to find: a. Right click the item sprite. Select duplicate. Place it in the scene. b. Repeat to add two more items. Hide them in the scene. c. If necessary, edit the code for item2, item3, and item4. Coding Tips: To change the hiding spot, add or edit a go to block. If you cannot see the object, click Show. 17. Use an operator to have the game end when all the items are found: a. Select the character sprite. b. Edit the script to add blocks to control when the game is over. Does the game do something special at the end? Pick an idea or think of your own idea. switch backdrops play a sound 18. Use your skills to prepare the project page. Play classmates' treasure hunts. Copyright © TechnoKids Inc. 124 TechnoCode | Scratch 3 Session 5 Session 5 Extension Activity: Chat with a Sprite A variable is a factor that can change. You have made variables to track the score and time in a game. A variable can also be used to store information. Follow the instructions to have a sprite ask a question. The answer is saved and then used to chat with the player in Scratch. You will make a script that asks What's your name? The player will answer. The sprite will then say the player's name. For example: Study the Scratch blocks to understand their purpose in the script: When starting a new game an answer must be blank. This block is used to reset a variable to remove a saved answer. This block is used to ask questions. It will show a text box that lets the player input their answer. This block reports the answer typed in by the player. Each answer needs a unique variable. This block assigns the answer given by the player to the variable. The operator block joins two things. In the first box is the words the sprite says. The second box has the answer given by the player. The sprite chats with the player using a say block and the edited operator block. 1. Open Scratch and start a new project. Save it as chat. 2. Insert a sprite that will ask questions. Delete Sprite1. 3. Create a name variable to store the player's answer: a. From the Blocks palette, select Variables. Click Make a Variable. b. Type name as the variable name. Click OK. c. From Variables, check name to see the answer. 4. Ask the player a question: a. From the Blocks palette, select Events. Drag onto the Scripts Area. b. From the Blocks palette, select Sensing. Add to the stack. c. Click Go. Type in an answer and click the checkmark. The name variable does not change. You need to add a block that assigns the answer to the name variable. Copyright © TechnoKids Inc. 125 TechnoCode | Scratch 3 Session 5 5. Assign the answer to the name variable: a. From the Blocks palette, select Variables. Add to bottom of the stack. b. Select my variable and select name from the list. c. From the Blocks palette, select Sensing. Drag into the block. d. Click Go. Type in an answer and click the checkmark. Notice that the answer now appears in the box. 6. Remove a saved answer from a previous game: a. From the Blocks palette, select Variables. Add below. b. Select my variable and select name from the list. c. Click Go. Notice the answer has been reset. Type in a different answer. 7. Chat with the player. Use the answer stored as the variable name: a. From the Blocks palette, select Looks. Add to the stack. b. From the Blocks palette, select Operators. Drag into. c. Replace apple with text that the sprite will say, such as Hi. Press the SPACEBAR. d. From the Blocks palette, select Variables. Drag into the block. e. Click Go. Type in an answer and click the checkmark. Notice that the sprite joins what they say with the answer. For example, Hi Ruby. Variables let you store answers and use them to interact with a player. 8. From the Blocks palette, select Variables. Remove the checkmark to hide the variable from the Stage. 9. Use your skills to make another question. Use the suggestions below or come up with your own idea: What is your favorite color? What show do you like to watch? What game do you like to play? 10. Use your skills to prepare the project page. Play classmates' chat game. Copyright © TechnoKids Inc. 126 TechnoCode | Scratch 3 Session 6 Curate an Activity Studio In this session, students build an Activity Studio for kids. It will have a collection of Scratch projects including an animated scene, maze, story, and game. To gain player feedback a link to the studio will be shared. Based on observation and questioning, students will make recommendations upon how they can improve their Activity Studio. Assignment 31: Build an Activity Studio Assignment 32: Gain Player Feedback Session 6 Review: Scratch Quiz Session 6 Extension Activity: Remix a Scratch Project Session 6 Assignment 31 Build an Activity Studio You have created fun activities for kids to play. You are now ready to share them with your audience. If you are using the online version of Scratch, you can build a studio with your completed projects. Players can then easily access the fish tank, maze, story, and game. Plan to Share the Activity Studio 1. The Activity Studio was made for young children. Who can you invite to play in the Activity Studio? 2. You can share the Activity Studio as a link. The link can be emailed, bookmarked on a device, or posted to a website or blog. How will you share the link? send an email post to a website or blob bookmark the link other: Open Scratch and View Saved Projects Sign in to Scratch. Click on your username. Select My Stuff from the menu. Build a Studio Click New Studio. Replace Untitled Studio with Activity Studio. Click inside the description box. Describe the studio. For example, A collection of activities for kids. (Optional) Insert an image for the Activity Studio. Click Change and select a saved image file. It must be no greater than 512 kb and 500x500. Copyright © TechnoKids Inc. 129 TechnoCode | Scratch 3 Session 6 Add Projects to the Activity Studio Click Add projects. Select the fish tank from the pane below. Click Add. Repeat to add the remaining projects such as story, maze, and game. Test the Studio Click on one of the projects inside the Activity Studio. It will open to the project page and can now be viewed or played. Click on the Activity Studio to return to the collection. Share the Activity Studio The link to the Activity Studio is in the address bar. Copy the address. Share it with the person you picked to play in the Activity Studio. Exit Scratch Copyright © TechnoKids Inc. 130 TechnoCode | Scratch 3 Session 6 Assignment 32 Gain Player Feedback You have invited someone to test the Activity Studio. Have the person open the Activity Studio and play two or more of the activities. While they are playing, watch their reaction. Afterwards, ask questions to find out what they think. Use the information to determine how you could improve the activities or design new ones. Name of Child Tester: Age: Record your Observations Write down what is happening when you see these reactions: 1. smile or laugh 2. sigh or groan 3. What other reactions did you see? Seek the Opinion of Others 4. Ask the question, Which activity did you like the most? Record the answer. 5. Ask the question, Why did you like it? Record the answer. 6. Think of your own question to ask. Record the answer. Question: Copyright © TechnoKids Inc. 131 TechnoCode | Scratch 3 Session 6 Ideas to Improve the Activity Studio 7. Which activity could you edit to make it even better? What change would you make? 8. What new activity could you add to the Activity Studio? Why do you think kids will like it? Copyright © TechnoKids Inc. 132 TechnoCode | Scratch 3 Session 6 Session 6 Review: Scratch Quiz Pick the correct action that will happen. 1. a. run a script when a broadcast message is received b. send a message to a sprite c. run a script to show a message in a speech bubble 2. a. broadcast a script to run if a message is received b. run a script only if a condition is true c. create a variable to keep score /2 Pick the correct block to do the action. 3. You want a sprite to send a message to another sprite and then pause until all actions triggered by the broadcast have finished. a. b. c. 4. You want a sprite to face left. a. b. c. 5. You want a sprite to do an action if the mouse pointer contacts it. a. b. c. 6. Increase the score in a game. a. b. c. /4 Copyright © TechnoKids Inc. 133 TechnoCode | Scratch 3 Session 6 Put the blocks in the correct order. 7. You want a sprite to be the mouse pointer when it receives a message. Order the blocks. 8. You want a timer to count the time in a game up to 15 seconds, then send a message that the game is finished. Order the blocks. /2 Debug the script. Find and fix the mistake. 9. The script should cause a sprite, when it is clicked, to trigger an action that makes it change from its original state to a twisting effect, and then move to the center of the stage. Circle the incorrect block. 10. Select the correct block to fix the script. a. b. c. 11. The script should give the game player a positive message if they achieve a score higher than 50. If they get a score less than 50, they are told to try again. Circle the incorrect block. 12. Select the correct block to fix the script. a. b. c. /2 TOTAL: /10 Copyright © TechnoKids Inc. 134 TechnoCode | Scratch 3 Session 6 Session 6 Extension Activity: Remix a Scratch Project Remix it! Invent something new using an existing Scratch project. When finished, give the Scratcher credit for building the original code. 1. Sign into Scratch. 2. Find a Scratch project you would like to edit: 3. Click Remix in the top right corner. The project is copied to your Scratch profile. The filename reads project remix. 4. Edit the code to transform it into something new. Use the suggestions or come up with your own idea: Fish Tank Paint a new backdrop for the fish tank. Add another fish to the tank. Maze Replace the message shown at the end of the game with new text. Add or change a sound clip. Story Change an effect to another option such as mosaic or fisheye. Edit the costume of a sprite. Insert a new sprite. Build a script that has the sprite do an action or change appearance when clicked. Game Adjust the scoring earned by touching targets. Increase or decrease the timing of the game. Add sprites to decorate the scene. Insert a new target. 5. Share the project. Add viewing instructions and give credit to the original Scratcher: a. Click See project page. b. Verify that the Instructions are clear. c. In the Notes and Credits thank the original Scratcher and describe the changes made to the project. Copyright © TechnoKids Inc. 135 TechnoCode | Scratch 3 Session 6 Answer Questions About the Remixed Project 1. What is the benefit to working with an existing project? 2. What did you learn by working with someone else's code? 3. Why do you need to give credit to the original Scratcher? Copyright © TechnoKids Inc. 136 TechnoCode | Scratch 3