Scratch Belt //Cover page Table of Contents Getting Setup Getting Started //Initialize Project 1: Start at Start Project 2: Just Keep Moving Project 3: Dance, Dance, Music Project 4: Cat and Mouse Project 5: March Madness Project 6: DEBUG! Lost in Space 1 Help Me! Project 7: Recap 1 //Main Loop Project 8: Prize Wheel Project 9: Amazing Maze Project 10: Pogo Ninja Table of Contents Project 11: Sensei Says Project 12: Street Race Project 13: DEBUG! Lost in Space 2 Help Me Too! Project 14: Recap 2 //Exit State Project 15: Tower of Power Project 16: Fall Down Project 17: Dash and Jump Project 18: Hidden Key Project 19: Home Run Derby Project 20: DEBUG! Lost in Space 3 Help Me Three! Project 21: Recap 3 //End of book Glossary Table of Contents Visit Scratch at scratch.mit.edu Copy your account below! Getting Setup Username: ___________________ Password: ___________________ Email:________________________ Join Scratch ( Video Guide ) Watch this guide for getting up to speed! Youtube Don’t worry! All this will be covered as we move through the book. Getting Started Project 1 : Start at start. We all must start somewhere and the same is true for Scratch. Scratch has special blocks called hat blocks (pictured below) that tell Scratch when to start a script. The text inside the hat block tells us when it will run. This is the event that causes the code to start. When do you think the three hat blocks below will run? Concepts: Events Video Links! 1. Please click this link to open Project 1 2. Click remix. 3. Select the Rocks Uh oh! Looks like three of our scripts are missing hat blocks . This means they will never run . Let’s go ahead and fix that. Turn the page. 4. The yellow squares are comments Comments are useful to explain what your code does. The computer ignores comments as they are only for us humans. Take a moment to read the comments. 5. Test of skills or trial and error ? Can you add the correct hat block from the answer bank below to each script? Good Job Ninja! You completed your first lesson. I would say that is a good start! How long can you stay alive in this first game? The difficulty can be adjusted by changing the number inside the “ Glide (2) secs to [Rocketship] ”. Project 2 : Just Keep Moving. Concepts: Events | Motion Everything has a place and there is a place for everything! Scratch says where a place is with an X and Y grid. As we move left or right we change our X position . When we go up or down we change the Y position Video Links! 1. Open this link and try it out for yourself ! 2. Click the green flag and drag the ball to different spots. See how the X and Y positions change? What happens to the Y position when the ball goes under the yellow horizontal line? What happens to the X position when the ball goes to the left of the blue vertical line? Are you able to get the ball slightly past the right edge of the screen? Did the X position go past 240 as the ball is halfway off the right side of the screen? Hone Your Skills. 3. Click this link to open Project 2 4. Click remix and then select the Fish 🐟 5. When you click play the shark chases our fish and we can’t move! We need our fish to move when we press a key . Let’s add these blocks. 6. Feel free to change the movement keys. You can use W, A, S, D or any keys you want. 7. Test of skills or trial and error ? The ninja decides. Not knowing the solution is ok. Wanting to try and find a solution is just as important as knowing the solution itself. Below is an answer bank Two of the blocks are correct. Find and attach the block that will make the fish move up , and the block that will move the fish down to the matching hat block from step 5. Did you find the answers? Which block worked for moving the fish down when we press the down key? Which block worked for moving the fish up when we press the up key? 8. Let’s add some realism. We want our fish pointing down or up as it swims. We can control direction with the point in direction block. The fish will match the arrow in the point in direction wheel. Good Job Ninja! You completed your second lesson. Just keep moving and you will be a black belt in no time! Remember fish are ninjas too. The speed of the fish can be adjusted by changing the 10 and - 10 to different values. You can use any speed you like for your game. Project 3 : Dance , Dance , Music Concepts: Events | Looks | Sound In Scratch characters in our game are called sprites . A sprite can be just a simple picture or a collection of pictures. Each frame in the collection of pictures is called a costume in Scratch. For some sprites we can change frames to make the sprite seem like they are moving. These are the different frames of the sprite Ten80. Video Links! 1. Please click this link to open Project 3 2. Click remix 3. We need to add our dancing sprite! To add a sprite to the game click the add sprite button in the bottom right. 4. Select the dance tab at the top. 5. Please select any of the sprites shown below from the tab. The choice is yours! Amon can’t make it to the party. He left his other costumes at home. Sadly, he won’t work well for this game. 😢 6. Once your sprite is added you can click the costumes tab (top left) to see all of their costume frames Some of Ten80’s costume frames. Click on some of the different costume frames Notice how your sprite changes to that frame in the game? We can control animations by switching between frames with code. 7. Let’s click back on the code tab (top left). 8. We need to add four hat blocks from events to tell Scratch where to start. You can do this! Setup four hat blocks for up, down, left, and right . You can do arrow keys or W,A,S,D. What block do you think it is? 9. We will use code to switch our costume frame. This will make our character “dance” each time we hit a key. Select the looks bubble from the left - hand side and add a next costume block to each hat block. New code time! You can make your own custom events in Scratch. These are the broadcast blocks. They broadcast an event and cause hat blocks listening for that event to start their code! Do not add these blocks