scratch 2 clone wars · 2020. 3. 18. · codeclub.org.uk - if your club is not on the map then...
TRANSCRIPT
-
1TheseprojectsareforuseinCodeClubswithintheUK.ForclubsoutsidetheUK,pleasevisitprojects.codeclubworld.org.Ourcurriculumisdevelopedintheopenon
GitHub(github.com/CodeClub),andweencouragecontributionsfromourcommunity-comeandjoinus!
ActivityChecklist
TestyourProject
SaveyourProject
AllCodeClubsmustberegistered.Registeredclubsappearonthemapatcodeclub.org.uk-ifyourclubisnotonthemapthenvisitjumpto.cc/18CpLPytofindoutwhattodo.
IntroductionInthisprojectyou’lllearnhowtocreateagameinwhichyouhaveto
savetheEarthfromspacemonsters.
FollowtheseINSTRUCTIONSonebyone
ClickonthegreenflagtoTESTyourcode
MakesuretoSAVEyourworknow
CloneWarsScratch
2
-
2TheseprojectsareforuseinCodeClubswithintheUK.ForclubsoutsidetheUK,pleasevisitprojects.codeclubworld.org.Ourcurriculumisdevelopedintheopenon
GitHub(github.com/CodeClub),andweencouragecontributionsfromourcommunity-comeandjoinus!
Step1:MakingaSpaceship
Let’smakeaspaceshipthatwilldefendtheEarth!
ActivityChecklist
1. StartanewScratchprojectanddeletethecatspritesothat
yourprojectisempty.YoucanfindtheonlineScratcheditor
atjumpto.cc/scratch-new.
2. Addthe‘stars’backdropandthe‘Spaceship’spritetoyour
project.Shrinkthespaceshipandmoveitnearthebottomof
thescreen.
3. Addcodetomoveyourspaceshiptotheleftwhentheleft
arrowkeyispressed.You’llneedtousetheseblocks:
-
3TheseprojectsareforuseinCodeClubswithintheUK.ForclubsoutsidetheUK,pleasevisitprojects.codeclubworld.org.Ourcurriculumisdevelopedintheopenon
GitHub(github.com/CodeClub),andweencouragecontributionsfromourcommunity-comeandjoinus!
Step2:Lightningbolts
Let’sgivethespaceshiptheabilitytofirelightningbolts!
ActivityChecklist
4. Addcodetomoveyourspaceshiptotherightwhentheright
arrowkeyispressed.
5. Testyourprojecttoseewhetheryoucancontrolyour
spaceshipwiththearrowkeys.
Saveyourproject
1. Addthe‘Lightning’spritefromtheScratchlibrary.Clickthe
sprite’scostumeandturnthelightningupside-down.
-
4TheseprojectsareforuseinCodeClubswithintheUK.ForclubsoutsidetheUK,pleasevisitprojects.codeclubworld.org.Ourcurriculumisdevelopedintheopenon
GitHub(github.com/CodeClub),andweencouragecontributionsfromourcommunity-comeandjoinus!
Note:Wemovethenewclonetothespaceshipwhileitisstillhidden,before
thenshowingit.Thisjustlooksnicer.
2. Whenthegameisstarted,thelightningshouldbehiddenuntil
thespaceshipfiresitslasercannons.
3. AddthefollowingcodetotheSpaceshiptocreateanew
lightningboltwheneverthespacekeyispressed.
4. Wheneveranewcloneiscreated,itshouldstartinthesame
placeasthespaceship,andthenmoveupthestageuntilit
touchestheedge.AddthefollowingcodetotheLightning
sprite:
1. Testyourlightning,bypressingthespacekey.
-
5TheseprojectsareforuseinCodeClubswithintheUK.ForclubsoutsidetheUK,pleasevisitprojects.codeclubworld.org.Ourcurriculumisdevelopedintheopenon
GitHub(github.com/CodeClub),andweencouragecontributionsfromourcommunity-comeandjoinus!
Challenge:Fixingthelightning
Whathappensifyoukeepthespacekeyhelddown?Canyou
usea wait blocktofixthis?
Step3:FlyingSpace-hippos
Let’saddlotsofflyinghipposthataretryingtodestroyyourspaceship.
ActivityChecklist
Saveyourproject
Saveyourproject
1. Createanewspritefromthe‘Hippo1’imageintheScratch
library.
2. Setitsrotationstyletobeleft-rightonly,andaddthefollowing
codetohidethespritewhenthegamestarts:
-
6TheseprojectsareforuseinCodeClubswithintheUK.ForclubsoutsidetheUK,pleasevisitprojects.codeclubworld.org.Ourcurriculumisdevelopedintheopenon
GitHub(github.com/CodeClub),andweencouragecontributionsfromourcommunity-comeandjoinus!
3. Createanewvariablecalled speed ,thatisforthehipposprite
only.
You’llknowifyou’vedonethiscorrectlybecausethevariablewill
havethenameofthespritenexttoit,likethis:
4. Thefollowingcodewillcreateanewhippoeveryfewseconds.
TheStageisagoodplaceforthiscodetolive:
5. Wheneachhippoclonestarts,makeitmovearoundthestage
(atarandomspeed)untilitgetshitbythelightning.Addthis
codetothehipposprite:
-
7TheseprojectsareforuseinCodeClubswithintheUK.ForclubsoutsidetheUK,pleasevisitprojects.codeclubworld.org.Ourcurriculumisdevelopedintheopenon
GitHub(github.com/CodeClub),andweencouragecontributionsfromourcommunity-comeandjoinus!
6. Testoutyourhippocode.Youshouldseeanewhippoclone
appeareveryfewseconds,eachmovingatitsownspeed.
7. Testyourlasercannon.Ifyouhitahippo,doesitvanish?
8. Whenahippotouchesyourspaceship,weneedtomakethe
spaceshipexplode!Todothis,firstmakesurethatyour
spaceshiphas2costumescalled‘normal’and‘hit’.
-
8TheseprojectsareforuseinCodeClubswithintheUK.ForclubsoutsidetheUK,pleasevisitprojects.codeclubworld.org.Ourcurriculumisdevelopedintheopenon
GitHub(github.com/CodeClub),andweencouragecontributionsfromourcommunity-comeandjoinus!
Thespaceship’s‘hit’costumecanbemadebyimportingthe
‘Sun’imagefromtheScratchlibrary,andusingthe‘Colora
shape’tooltochangeitscolour.
9. Addthiscodetoyourspaceshipsothatitswitchescostume
wheneveritcollideswithaflyinghippo:
10. Didyounoticethatyouhavebroadcasta‘hit’messageinthe
codeabove?Youcanusethismessagetomakeallofthe
hipposdisappearwhenthespaceshipishit.
Addthiscodetoyourhippo:
-
9TheseprojectsareforuseinCodeClubswithintheUK.ForclubsoutsidetheUK,pleasevisitprojects.codeclubworld.org.Ourcurriculumisdevelopedintheopenon
GitHub(github.com/CodeClub),andweencouragecontributionsfromourcommunity-comeandjoinus!
Challenge:LivesandScore
Canyouadda lives , score orevena highscore toyour
game?Youcanusethe‘CatchtheDots’projecttohelpyou.
Step4:FruitBats!
Let’smakeafruitbatthatthrowsorangesatyourspaceship.
ActivityChecklist
11. Testoutthiscodebystartinganewgameandcollidingwitha
hippo.
Saveyourproject
Saveyourproject
1. Firstly,makeanewbatspritethatwill move acrossthetopof
thestage forever .Remembertotestoutyourcode.
-
10TheseprojectsareforuseinCodeClubswithintheUK.ForclubsoutsidetheUK,pleasevisitprojects.codeclubworld.org.Ourcurriculumisdevelopedintheopenon
GitHub(github.com/CodeClub),andweencouragecontributionsfromourcommunity-comeandjoinus!
2. Ifyoulookatthebat’scostumes,you’llseethatitalreadyhas
2:
Usethe nextcostume blocktomakethebatflapitswingsas
itmoves.
3. Createanew‘Orange’spritefromtheScratchlibrary
4. Addcodetoyourbat,sothatitcreatesaneworangeclone
everyfewseconds.
5. Clickonyourorangespriteandaddthiscodetomakeeach
orangeclonedropdownthestagefromthebattowardsthe
spaceship:
-
11TheseprojectsareforuseinCodeClubswithintheUK.ForclubsoutsidetheUK,pleasevisitprojects.codeclubworld.org.Ourcurriculumisdevelopedintheopenon
GitHub(github.com/CodeClub),andweencouragecontributionsfromourcommunity-comeandjoinus!
Step5:Gameover
Let’sadda‘gameover’messageattheendofthegame.
ActivityChecklist
6. Inyourspaceshipsprite,you’llneedtomodifyyourcodeso
thatyouarehitifyoutouchahippooranorange:
7. Testyourgame.Whathappensifyougethitbyafalling
orange?
Saveyourproject
1. Ifyouhaven’talready,createanewvariablecalled lives .
Yourspaceshipshouldstartwith3livesandlosealifewhenever
-
12TheseprojectsareforuseinCodeClubswithintheUK.ForclubsoutsidetheUK,pleasevisitprojects.codeclubworld.org.Ourcurriculumisdevelopedintheopenon
GitHub(github.com/CodeClub),andweencouragecontributionsfromourcommunity-comeandjoinus!
itcollideswithanenemy.Yourgameshouldalsostopwhenyou
runoutoflives.Ifyouneedhelp,youcanusethe‘Catchthe
Dots’projecttohelpyou.
2. Drawanewspritecalled‘GameOver’,usingthetexttool.
3. Onyourstage,broadcasta gameover messagejustbefore
thegameends.
4. Addthiscodetoyour‘GameOver’sprite,sothatthemessage
showsattheendofthegame:
Becauseyou’veuseda broadcast[gameover]andwait block
onyourstage,itwillwaitforthe‘GameOver’spritetobe
displayedbeforeendingthegame.
5. Testyourgame.Howmanypointscanyouscore?Canyou
thinkofwaystoimproveyourgameifitistooeasyortoo
hard?
-
13TheseprojectsareforuseinCodeClubswithintheUK.ForclubsoutsidetheUK,pleasevisitprojects.codeclubworld.org.Ourcurriculumisdevelopedintheopenon
GitHub(github.com/CodeClub),andweencouragecontributionsfromourcommunity-comeandjoinus!
Challenge:Improveyourgame
Whatimprovementscanyoumaketoyourgame?Hereare
someideas:
Saveyourproject
Addhealthpacksthatyoucancollecttogainextralives;
Addfloatingrocksthatyourspaceshipmustavoid;
Makemoreenemiesappearwhenyourscoregetsto100.
Saveyourproject