Scratch3 - Ghostbusters

You might also like

Download as pdf
Download as pdf
You are on page 1of 19
4117126, 11.05.0M Ghostbusters 8 Projects Ghostbusters Make a game about catching ghosts! Step1 Introduction ‘You are going to make a ghost-catching game! © raryouwuinee Hardware + Acomputer Software + Scratch 3 {either online (https: //rpf.io/scratchon) or offline (https://rpfio/scratchoff)) @ sestvousiiam + Understand the need for pauses between actions within loops + Use code to generate random numbers in Seratch + Add 2 variable to store a game score in Scratch hnpsufprojects.raspberrypiorgleniprojeta/ghostoustersiprint ang 4117126, 11.05.0M Ghostbusters estona ots oredeatr You can find the completed project here (inttps://rpftio/p/en/ghostbusters-get), hnpsufprojects.raspberrypiorgleniprojeta/ghostoustersiprint ane 4117126, 11.05.0M Ghostbusters Step 2 Animate a ghost Open a new empty Scratch project. © creating anew each pret + Online - to create a new Scratch project using the online editor go to rpfio/scratch-new (http s://rpfio/scratch-new) + Offline -if you prefer to work offine and have not installed the editoryet. you can downloadit from rpfio/scratch-off (https://rpfio/scratch-off) ‘The Scratch editor looks lke this: ‘+ The cat sprite that you can see is the Scratch mascot. If you need an empty Scratch project, you can delete the cat by right-clicking it and then clicking delete. = duplicate export hnpsufprojects.raspberrypiorgleniprojeta/ghostoustersiprint 3a 4117126, 11.05.0M Ghostbusters ‘Add in a new ghost sprite and a suitable Stage backdrop. e ‘Add a sprite from the Sprite Library Click on Choose a Sprite to open the Sprite Library: You can search fora sprite, or browse for one by category. Click on a sprite to add it to your project. — 4 OM 4 }* &€ & @@ © sat aveckion rom the Bokdop Lay Click on Choose a Backdrop in the bottom right-hand corner of the screen to open the Backdrop Library: hnpsufprojects.raspberrypiorgleniprojeta/ghostoustersiprint ang 4117126, 11.05.0M Ghostbusters You can search fora backdrop, or browse for ane by category. Click on @ backdrop to add it to your project. PEocsoecee SBEa“nan BxRae— hnpsufprojects.raspberrypiorgleniprojeta/ghostoustersiprint 4117126, 11.05.0M Ghostbusters ‘Add code to your ghost sprite so that the ghost appears and disappears forever when the green flag is, clicked. Ineed a hint This is what your code should look Ii when __ clicked lg icy watt QD seconds show wait @P seconds hnpsufprojects.raspberrypiorgleniprojeta/ghostoustersiprint eng 4117126, 11.05.0M Ghostbusters ‘Test and save your project, © seve yourseratch project First, to give your program a name, type the name of your program in the project name box at the top. of the screen: Note: If you are not online or you do not have a Scratch account, you can click on Save to your ‘computer to save a copy of your project. hnpsufprojects.raspberrypiorgleniprojeta/ghostoustersiprint 79 srt7r28, 11.05.00 Ghostbusters Step 3 Random ghosts Your ghost is really easy to catch at the moment. because it doesn’t movel hitpsiprojects.taspberypiorg/en/projects(ghostoustersiprint ang 4117126, 11.05.0M Ghostbusters stead of staying in the same posi the ghost appears at Can you add code to your ghost so that, random positions on the Stage? Ineed a hint Your code could look either like this: when __ clicked lg icy watt QD seconds CONC U CU Se ia Aires wait @P seconds Orit could look like this: hnpsufprojects.raspberrypiorgleniprojeta/ghostoustersiprint ong 4117126, 11.05.0M Ghostbusters OU ac) go tox: pickrandom QED) co ED ¥: vickrancom ED o ED ev oe hnpsufprojects.raspberrypiorgleniprojeta/ghostoustersiprint sone 4117126, 11.05.0M Ghostbusters en Challenge: more randomness Can youadd code to your ghost sprite to make the ghost (EIB @ random amount of time while itis hidden? Can you use the block to make your ghost a randomly larger or smaller each time it appears? hnpsufprojects.raspberrypiorgleniprojeta/ghostoustersiprint anne 4117126, 11.05.0M Ghostbusters Step 4 Code for catching ghosts Now you're going to acd code to your game so that the player can catch ghosts! Can you make your ghost disappear when it's been caught? The player should be able to click ghosts to catch them, Ifyou test your game and find catching ghosts difficult, you can play the game in full-screen mode by clicking on this button: Ineed a hint Your code should look lke this: when this sprite clicked hnpsufprojects.raspberrypiorgleniprojeta/ghostoustersiprint rane 4117126, 11.05.0M Ghostbusters & chattenget Challenge: add a sound ‘Can you add code to your ghost so that the ghost makes a sound when it's caught? hnpsufprojects.raspberrypiorgleniprojeta/ghostoustersiprint 1319 4117126, 11.05.0M Ghostbusters Step5 Addascore Now you're going to make your garne more interesting by keeping score! Create 2 new variable caller ©} Ac avariabiein seraten + Click on Variables in the Code t2b, then click on Make a Variable. er, Variables FON (cere ‘+ Type in the name of yourvariable. You can choose whether you would lke your variable to be available to all sprites, orto only this sprite, Press OK. "Now variable name: @For all spites OFor this sprite only + Once you have created the variable, it will be displayed on the Stage, or you can untick the variable in the Scripts tab to hide it hnpsufprojects.raspberrypiorgleniprojeta/ghostoustersiprint sane srt7r28, 11.05.00 Ghostbusters Can you keep track of the player's score? Players should score points when they click on ghosts te catch them, Each time a player clicks on a ghost, their score should increase. Ineed a hint OT a) PUR cae hide emp(eape]a ) hitpsiprojects.taspberypiorg/en/projects(ghostoustersiprint 1519 4117126, 11.05.0M Ghostbusters Step6 Addatimer Now you're going to acd a timer so that the player only nas ten seconds to catch as many ghosts as possible, Create a new variable called ‘time’, Can you add a timer to your Stage to give your player on\y 10 seconds to catch ghosts? Your timer should: + Start at 10 seconds * Count down every second ‘The game should stop when the timer gets to 0, Ineed a hint Here is the code you should add to create a timer RT acc) a) ry wait @P seconds Aska friend to test your game. How many points can they score? If your game is too easy, you can: hnpsufprojects.raspberrypiorgleniprojeta/ghostoustersiprint 169 4117126, 11.05.0M Ghostbusters + Givethe playerless time + Make the ghosts appearless often «+ Make the ghosts smaller Change and test your game a few times until you're happy with its level of difficulty. hnpsufprojects.raspberrypiorgleniprojeta/ghostoustersiprint sme 4117126, 11.05.0M Ghostbusters Ce Challenge: more sprites Can you add other sprites to your game? You need to think about some things for each sprites you want to add: + How big should the sprite be? + Should it appear more or less often than the ghost sprite? ‘+ What does it look/sound like when it gets caught? + How many points does the player win (orlose) for catching the sprite? Ifyou need help, you can back through to the instructions in the previous steps, oraska friend! hnpsufprojects.raspberrypiorgleniprojeta/ghostoustersiprint reno 4117126, 11.05.0M Ghostbusters Step7 What next? ‘Well done on completing the Ghostbusters project! Do you want to create something a little more challenging? Try out the Chatbot (https: /projects.raspberrypiorg/en/projects/chatbot?utm_source=pathway&utm_me dium:whatnextautm_campaign=projects) project. Published by Raspberry Pi Foundation (https://www.raspberrypi.org) under a Creative Commons license (https://creativecommons.org/licenses/by-sa/4.0/), View project & license on GitHub (https://github.com/RaspberryPiLearning/ghostbusters) hnpsufprojects.raspberrypiorgleniprojeta/ghostoustersiprint s9n9

You might also like