Scratch 2 Brain Game - Mrs Armenio's Web class...end of each game. 8. You’ll also need to stop...
Transcript of Scratch 2 Brain Game - Mrs Armenio's Web class...end of each game. 8. You’ll also need to stop...
![Page 1: Scratch 2 Brain Game - Mrs Armenio's Web class...end of each game. 8. You’ll also need to stop your character asking questions at the end of each game: 9. Test your play button by](https://reader033.fdocuments.us/reader033/viewer/2022041721/5e4e8901454bc37ec26947cf/html5/thumbnails/1.jpg)
1TheseprojectsareforuseoutsidetheUKonly.Moreinformationisavailableonourwebsiteatwww.codeclubworld.org.
ThiscourseworkisdevelopedintheopenonGitHub,atwww.github.com/CodeClub.Comeandjoinus!
ActivityChecklist
TestyourProject
SaveyourProject
AllCodeClubsmustberegistered.Registeredclubsappearonthemapatcodeclubworld.org-ifyourclubisnotonthemapthenvisitjumpto.cc/ccwregtoregisteryourclub.
IntroductionInthisprojectyou’lllearnhowtocreateatimestablequiz,inwhichyou
havetogetasmanyanswerscorrectasyoucanin30seconds.
FollowtheseINSTRUCTIONSonebyone
ClickonthegreenflagtoTESTyourcode
MakesuretoSAVEyourworknow
BrainGameScratch
2
![Page 2: Scratch 2 Brain Game - Mrs Armenio's Web class...end of each game. 8. You’ll also need to stop your character asking questions at the end of each game: 9. Test your play button by](https://reader033.fdocuments.us/reader033/viewer/2022041721/5e4e8901454bc37ec26947cf/html5/thumbnails/2.jpg)
2TheseprojectsareforuseoutsidetheUKonly.Moreinformationisavailableonourwebsiteatwww.codeclubworld.org.
ThiscourseworkisdevelopedintheopenonGitHub,atwww.github.com/CodeClub.Comeandjoinus!
Step1:Creatingquestions
Let’sstartbycreatingrandomquestionsfortheplayertoanswer.
ActivityChecklist
1. StartanewScratchproject,anddeletethecatspritesothat
yourprojectisempty.YoucanfindtheonlineScratcheditor
atjumpto.cc/scratch-new.
2. Chooseacharacterandabackdropforyourgame.Youcan
chooseanyyoulike!Here’sanexample:
3. Create2newvariablescalled number1 and number2 .These
variableswillstorethe2numbersthatwillbemultiplied
together.
![Page 3: Scratch 2 Brain Game - Mrs Armenio's Web class...end of each game. 8. You’ll also need to stop your character asking questions at the end of each game: 9. Test your play button by](https://reader033.fdocuments.us/reader033/viewer/2022041721/5e4e8901454bc37ec26947cf/html5/thumbnails/3.jpg)
3TheseprojectsareforuseoutsidetheUKonly.Moreinformationisavailableonourwebsiteatwww.codeclubworld.org.
ThiscourseworkisdevelopedintheopenonGitHub,atwww.github.com/CodeClub.Comeandjoinus!
4. Addcodetoyourcharacter,tosetbothofthesevariablesto
a random numberbetween2and12.
5. Youcanthenasktheplayerfortheanswer,andletthemknow
iftheywererightorwrong.
6. Testyourprojectfully,byansweringonequestioncorrectly
andonewiththewronganswer.
7. Adda forever looparoundthiscode,sothattheplayeris
askedlotsofquestions.
8. Createacountdowntimeronthestage,usingavariablecalled
time .The‘Balloons’projecthasinstructionsformakinga
timer(instep6)ifyouneedhelp!
9. Testyourprojectagain-youshouldbeabletocontinueasking
questionsuntilthetimerunsout.
![Page 4: Scratch 2 Brain Game - Mrs Armenio's Web class...end of each game. 8. You’ll also need to stop your character asking questions at the end of each game: 9. Test your play button by](https://reader033.fdocuments.us/reader033/viewer/2022041721/5e4e8901454bc37ec26947cf/html5/thumbnails/4.jpg)
4TheseprojectsareforuseoutsidetheUKonly.Moreinformationisavailableonourwebsiteatwww.codeclubworld.org.
ThiscourseworkisdevelopedintheopenonGitHub,atwww.github.com/CodeClub.Comeandjoinus!
Challenge:Changingcostumes
Canyouchangeyourcharacter’scostumes,sothatthey
respondtotheplayer’sanswer?
Challenge:Addingascore
Canyouaddascoretoyourgame?Youcanaddapointfor
everycorrectanswer.Ifyou’refeelingmean,youcouldeven
resettheplayer’sscoreto0iftheygetaquestionwrong!
Saveyourproject
Saveyourproject
![Page 5: Scratch 2 Brain Game - Mrs Armenio's Web class...end of each game. 8. You’ll also need to stop your character asking questions at the end of each game: 9. Test your play button by](https://reader033.fdocuments.us/reader033/viewer/2022041721/5e4e8901454bc37ec26947cf/html5/thumbnails/5.jpg)
5TheseprojectsareforuseoutsidetheUKonly.Moreinformationisavailableonourwebsiteatwww.codeclubworld.org.
ThiscourseworkisdevelopedintheopenonGitHub,atwww.github.com/CodeClub.Comeandjoinus!
Step2:Multiplegames
Let’sadda‘play’buttontoyourgame,sothatyoucanplaylotsoftimes.
ActivityChecklist
1. Createanew‘Play’buttonsprite,whichyourplayerwillclickto
startanewgame.Youcandrawityourself,oreditasprite
fromtheScratchlibrary.
2. Addthiscodetoyournewbutton.
Thiscodeshowstheplaybuttonwhenyourprojectisstarted.
Whenthebuttonisclicked,itishiddenandthenbroadcastsa
messagethatwillstartthegame.
3. You’llneedtoedityourcharacter’scode,sothatthegame
startswhentheyreceivethe start message,andnotwhen
theflagisclicked.
![Page 6: Scratch 2 Brain Game - Mrs Armenio's Web class...end of each game. 8. You’ll also need to stop your character asking questions at the end of each game: 9. Test your play button by](https://reader033.fdocuments.us/reader033/viewer/2022041721/5e4e8901454bc37ec26947cf/html5/thumbnails/6.jpg)
6TheseprojectsareforuseoutsidetheUKonly.Moreinformationisavailableonourwebsiteatwww.codeclubworld.org.
ThiscourseworkisdevelopedintheopenonGitHub,atwww.github.com/CodeClub.Comeandjoinus!
Replacethe whenflagclicked codewith whenIreceive
start .
4. Clickthegreenflagandthenclickyournewplaybuttontotest
it.Youshouldseethatthegamedoesn’tstartuntilthebutton
isclicked.
5. Didyounoticethatthetimerstartswhenthegreenflagis
clicked,andnotwhenthegamestarts?
Canyoufixthisproblem?
6. Clickonthestage,andreplacethe stopall blockwithan
end message.
![Page 7: Scratch 2 Brain Game - Mrs Armenio's Web class...end of each game. 8. You’ll also need to stop your character asking questions at the end of each game: 9. Test your play button by](https://reader033.fdocuments.us/reader033/viewer/2022041721/5e4e8901454bc37ec26947cf/html5/thumbnails/7.jpg)
7TheseprojectsareforuseoutsidetheUKonly.Moreinformationisavailableonourwebsiteatwww.codeclubworld.org.
ThiscourseworkisdevelopedintheopenonGitHub,atwww.github.com/CodeClub.Comeandjoinus!
7. Youcannowaddcodetoyourbutton,toshowitagainatthe
endofeachgame.
8. You’llalsoneedtostopyourcharacteraskingquestionsatthe
endofeachgame:
9. Testyourplaybuttonbyplayingacoupleofgames.Youshould
noticethattheplaybuttonshowsaftereachgame.Tomake
testingeasier,youcanshorteneachgame,sothatitonlylasts
afewseconds.
10. Youcanevenchangehowthebuttonlookswhenthemouse
hoversoverit.
![Page 8: Scratch 2 Brain Game - Mrs Armenio's Web class...end of each game. 8. You’ll also need to stop your character asking questions at the end of each game: 9. Test your play button by](https://reader033.fdocuments.us/reader033/viewer/2022041721/5e4e8901454bc37ec26947cf/html5/thumbnails/8.jpg)
8TheseprojectsareforuseoutsidetheUKonly.Moreinformationisavailableonourwebsiteatwww.codeclubworld.org.
ThiscourseworkisdevelopedintheopenonGitHub,atwww.github.com/CodeClub.Comeandjoinus!
Challenge:Startscreen
Canyouaddanotherbackdroptoyourstage,whichwillbecome
yourgame’sstartscreen?Youcanusethe whenIreceive
start and whenIreceiveend blockstoswitchbetween
backdrops.
Youcanalsoshowandhideyourcharacter,andevenshowand
hideyourtimerbyusingtheseblocks:
Saveyourproject
Saveyourproject
![Page 9: Scratch 2 Brain Game - Mrs Armenio's Web class...end of each game. 8. You’ll also need to stop your character asking questions at the end of each game: 9. Test your play button by](https://reader033.fdocuments.us/reader033/viewer/2022041721/5e4e8901454bc37ec26947cf/html5/thumbnails/9.jpg)
9TheseprojectsareforuseoutsidetheUKonly.Moreinformationisavailableonourwebsiteatwww.codeclubworld.org.
ThiscourseworkisdevelopedintheopenonGitHub,atwww.github.com/CodeClub.Comeandjoinus!
Step3:Addinggraphics
Insteadofyourcharacterjustsaying yes!:) or nope:( totheplayer,let’s
addsomegraphicsthatwilllettheplayerknowhowtheyaredoing.
Createanewspritecalled‘Result’,containingbotha‘tick’anda‘cross’
costume.
Changeyourcharacter’scode,sothatinsteadoftellingtheplayerhowthey
did,itbroadcasts correct and wrong messagesinstead.
Youcannowusethesemessagestoshowthe‘tick’or‘cross’costume.Add
thiscodetoyournew‘Result’sprite:
![Page 10: Scratch 2 Brain Game - Mrs Armenio's Web class...end of each game. 8. You’ll also need to stop your character asking questions at the end of each game: 9. Test your play button by](https://reader033.fdocuments.us/reader033/viewer/2022041721/5e4e8901454bc37ec26947cf/html5/thumbnails/10.jpg)
10TheseprojectsareforuseoutsidetheUKonly.Moreinformationisavailableonourwebsiteatwww.codeclubworld.org.
ThiscourseworkisdevelopedintheopenonGitHub,atwww.github.com/CodeClub.Comeandjoinus!
Testoutyourgameagain.Youshouldseeatickwheneveryougeta
questioncorrect,andacrosswheneveryougetonewrong!
Haveyounoticedthatthecodefor whenIreceivecorrect and whenI
receivewrong isnearlyidentical?Let’screateafunctiontomakeiteasier
foryoutomakechangestoyourcode.
Onyour‘Result’sprite,click MoreBlocks ,andthen‘MakeaBlock’.Create
anewfunctioncalled animate .
![Page 11: Scratch 2 Brain Game - Mrs Armenio's Web class...end of each game. 8. You’ll also need to stop your character asking questions at the end of each game: 9. Test your play button by](https://reader033.fdocuments.us/reader033/viewer/2022041721/5e4e8901454bc37ec26947cf/html5/thumbnails/11.jpg)
11TheseprojectsareforuseoutsidetheUKonly.Moreinformationisavailableonourwebsiteatwww.codeclubworld.org.
ThiscourseworkisdevelopedintheopenonGitHub,atwww.github.com/CodeClub.Comeandjoinus!
Youcanthenaddtheanimationcodeintoyournewanimationfunction,and
thenjustusethefunctiontwice:
Now,ifyouwanttoshowthetickandthecrossforalongerorshorter
time,youonlyneedtomakeonechangetoyourcode.Tryit!
Insteadofjustshowingandhidingthetickandthecross,youcouldchange
youranimationfunction,sothatthegraphicsfadein.
![Page 12: Scratch 2 Brain Game - Mrs Armenio's Web class...end of each game. 8. You’ll also need to stop your character asking questions at the end of each game: 9. Test your play button by](https://reader033.fdocuments.us/reader033/viewer/2022041721/5e4e8901454bc37ec26947cf/html5/thumbnails/12.jpg)
12TheseprojectsareforuseoutsidetheUKonly.Moreinformationisavailableonourwebsiteatwww.codeclubworld.org.
ThiscourseworkisdevelopedintheopenonGitHub,atwww.github.com/CodeClub.Comeandjoinus!
Challenge:Improvedanimation
Canyouimprovetheanimationofyourgraphics?Youcould
codethetickandcrosssothattheyfadeoutaswellasfadein.
Or,youcoulduseothercooleffects:
Saveyourproject
Saveyourproject
![Page 13: Scratch 2 Brain Game - Mrs Armenio's Web class...end of each game. 8. You’ll also need to stop your character asking questions at the end of each game: 9. Test your play button by](https://reader033.fdocuments.us/reader033/viewer/2022041721/5e4e8901454bc37ec26947cf/html5/thumbnails/13.jpg)
13TheseprojectsareforuseoutsidetheUKonly.Moreinformationisavailableonourwebsiteatwww.codeclubworld.org.
ThiscourseworkisdevelopedintheopenonGitHub,atwww.github.com/CodeClub.Comeandjoinus!
Challenge:Soundandmusic
Canyouaddsoundeffectsandmusictoyourgame?For
example:
Playingasoundwhentheplayergetsananswerrightor
wrong;
Addingatickingsoundtoyourcountdowntimer;
Playingasoundwhenthetimeisup;
Youcouldalsoconstantlyplaymusiconaloop(ifyou’re
notsurehowtodothis,step4ofthe‘RockBand’project
willhelpyou).
Saveyourproject
![Page 14: Scratch 2 Brain Game - Mrs Armenio's Web class...end of each game. 8. You’ll also need to stop your character asking questions at the end of each game: 9. Test your play button by](https://reader033.fdocuments.us/reader033/viewer/2022041721/5e4e8901454bc37ec26947cf/html5/thumbnails/14.jpg)
14TheseprojectsareforuseoutsidetheUKonly.Moreinformationisavailableonourwebsiteatwww.codeclubworld.org.
ThiscourseworkisdevelopedintheopenonGitHub,atwww.github.com/CodeClub.Comeandjoinus!
Challenge:Raceto10points
Canyouchangeyourgame,sothatinsteadofansweringas
manyquestionsastheycanin30seconds,theplayerhasto
seehowquicklytheycanget10questionscorrect?
Todothis,you’llonlyneedtochangeyourtimercode.Canyou
seewhatneedstobechanged?
Saveyourproject
![Page 15: Scratch 2 Brain Game - Mrs Armenio's Web class...end of each game. 8. You’ll also need to stop your character asking questions at the end of each game: 9. Test your play button by](https://reader033.fdocuments.us/reader033/viewer/2022041721/5e4e8901454bc37ec26947cf/html5/thumbnails/15.jpg)
15TheseprojectsareforuseoutsidetheUKonly.Moreinformationisavailableonourwebsiteatwww.codeclubworld.org.
ThiscourseworkisdevelopedintheopenonGitHub,atwww.github.com/CodeClub.Comeandjoinus!
Challenge:Instructionscreen
Canyouaddaninstructionsscreentoyourgame,tellingyour
playerhowtoplaythegame?You’llneedan‘Instructions’
button,andanotherstagebackground.
Youmayalsoneeda‘Back’buttontotakeyoutothemain
menu.
Saveyourproject