Scratch Recycling - Dale Lanedalelane.co.uk › drpbx › codeclubprojects › en-GB ›...
Transcript of Scratch Recycling - Dale Lanedalelane.co.uk › drpbx › codeclubprojects › en-GB ›...
1TheseprojectsareforuseinCodeClubswithintheUK.Forc lubsoutsidetheUK,pleasevisitprojects.codeclubworld.org.Ourcurriculumisdeveloped
intheopenonGitHub(github.com/CodeClub),andweencouragecontributionsfromourcommunity-comeandjoinus!
ActivityChecklist
AllCodeClubsmustberegistered.Registeredclubsappearonthemapatcodeclub.org.uk-ifyourclubisnotonthemapthenvisitjumpto.cc/18CpLPytofindoutwhattodo.
IntroductionWe’regoingtomakearecyclinggame!Catchthefallingitems,andput
theminthecorrectrecyclingbins.
Usethearrowkeystorunleftandright
Pressspacebartothrowwhatyou’recarrying
Gettherubbishinthecorrectrecyclingbin
FollowtheseINSTRUCTIONSonebyone
RecyclingScratch
+
2TheseprojectsareforuseinCodeClubswithintheUK.Forc lubsoutsidetheUK,pleasevisitprojects.codeclubworld.org.Ourcurriculumisdeveloped
intheopenonGitHub(github.com/CodeClub),andweencouragecontributionsfromourcommunity-comeandjoinus!
TestyourProject
SaveyourProject
ClickonthegreenflagtoTESTyourcode
MakesuretoSAVEyourworknow
3TheseprojectsareforuseinCodeClubswithintheUK.Forc lubsoutsidetheUK,pleasevisitprojects.codeclubworld.org.Ourcurriculumisdeveloped
intheopenonGitHub(github.com/CodeClub),andweencouragecontributionsfromourcommunity-comeandjoinus!
Step1:Createthecharacterthatwillpickuptherubbish
ActivityChecklist
1. StartanewScratchproject.
2. ChangethenameofSprite1tocatbyclickingontheblue i
symbol
3. Makesurethatitwillonlyflipleft-rightwiththeside-to-side
arrow.
4. Createavariable,forthisspriteonly,calledrunningspeed
5. Createavariable,forthisspriteonly,calledmaxspeed
6. Createavariable,forthisspriteonly,calledcats-direction
7. Untickallthreevariablessothey’renotshownontheStage
4TheseprojectsareforuseinCodeClubswithintheUK.Forc lubsoutsidetheUK,pleasevisitprojects.codeclubworld.org.Ourcurriculumisdeveloped
intheopenonGitHub(github.com/CodeClub),andweencouragecontributionsfromourcommunity-comeandjoinus!
8. UsetheMakeaBlockbuttoninMoreBlockstocreateanew
customblock
9. Namethenewcustomblockreset
10. Addascripttotheresetblockthatwillputthecatintheright
startingplaceandsetthespeedvariables
11. Createanothercustomblock,calledrun
12. Addthefollowingscripttorun,tomakeitpossibleforthecat
torunattherunningspeed,andslowdowngradually
5TheseprojectsareforuseinCodeClubswithintheUK.Forc lubsoutsidetheUK,pleasevisitprojects.codeclubworld.org.Ourcurriculumisdeveloped
intheopenonGitHub(github.com/CodeClub),andweencouragecontributionsfromourcommunity-comeandjoinus!
13. Combinethesewhenthegreenflagisclicked
14. Createacustomblockcalled“changedirectionifneeded”.It
shouldtakeonenumberinputcalleddirection
6TheseprojectsareforuseinCodeClubswithintheUK.Forc lubsoutsidetheUK,pleasevisitprojects.codeclubworld.org.Ourcurriculumisdeveloped
intheopenonGitHub(github.com/CodeClub),andweencouragecontributionsfromourcommunity-comeandjoinus!
15. Createacustomblockcalledspeedupifpossiblewhichwill
increasespeed,butonlyuntilthecatreachesmaxspeed
16. Starttobringthesetogetherwithanewcustomblockcalled
handlebuttonpresswhichtakesonenumberinputcalled
button-direction
7TheseprojectsareforuseinCodeClubswithintheUK.Forc lubsoutsidetheUK,pleasevisitprojects.codeclubworld.org.Ourcurriculumisdeveloped
intheopenonGitHub(github.com/CodeClub),andweencouragecontributionsfromourcommunity-comeandjoinus!
17. Finally,addascriptblockthatwillusethesecustomblocksto
controlthecat’srunning
18. Duplicateeachofthecat’stwocostumes.Wewanttwoofthe
firstcostume,andtwoofthesecondcostume.Thiswillprevent
therunninganimationfromflickeringtoomuch
8TheseprojectsareforuseinCodeClubswithintheUK.Forc lubsoutsidetheUK,pleasevisitprojects.codeclubworld.org.Ourcurriculumisdeveloped
intheopenonGitHub(github.com/CodeClub),andweencouragecontributionsfromourcommunity-comeandjoinus!
TestYourProject
Clickthegreenflag.
Saveyourproject
Usetheleftandrightarrowstorunfromsidetoside
Ifyouletgoofthearrowkeyafterpickingupspeed,thecatshould
slowdowngraduallyinsteadofstoppinginstantly
Ifyouswitchdirectionswhilerunning,thecatshouldskidinthewrong
directionbrieflybeforeswitching
9TheseprojectsareforuseinCodeClubswithintheUK.Forc lubsoutsidetheUK,pleasevisitprojects.codeclubworld.org.Ourcurriculumisdeveloped
intheopenonGitHub(github.com/CodeClub),andweencouragecontributionsfromourcommunity-comeandjoinus!
Thingstotry
Tryadjustingthespeeds-thenumberinspeedupif
possiblecontrolshowfastthecataccelerates,the
maxspeedvalueinresetcontrolsthecat’stopspeed.
10TheseprojectsareforuseinCodeClubswithintheUK.Forc lubsoutsidetheUK,pleasevisitprojects.codeclubworld.org.Ourcurriculumisdeveloped
intheopenonGitHub(github.com/CodeClub),andweencouragecontributionsfromourcommunity-comeandjoinus!
Step2:Addfallingrubbish
It’stimetomakeitemsforthecattorecycle!
ActivityChecklist
Preparethesprite
1. Uploadanewsprite,choosingResources/can.png
2. SwitchtotheCostumestab,anduploadanothercostume
usingResources/jar.png
3. UploadanothercostumeusingResources/newspaper.png
4. Thespriteshouldnowhavethreecostumes:acan,ajaranda
newspaper
11TheseprojectsareforuseinCodeClubswithintheUK.Forc lubsoutsidetheUK,pleasevisitprojects.codeclubworld.org.Ourcurriculumisdeveloped
intheopenonGitHub(github.com/CodeClub),andweencouragecontributionsfromourcommunity-comeandjoinus!
Gettherubbishtofallfromthesky
5. Clickontheblue i nexttothesprite,andrenamethesprite
tobecalledobject
6. ResizethespritebyclickingontheShrinkbuttonatthetop
7. ClickontheSpriteinthemainstagewindowseveraltimes,until
itissmallerthanthecat
1. Createavariablethatwillcontrolthespeedtherubbishfalls,
calledspeed
12TheseprojectsareforuseinCodeClubswithintheUK.Forc lubsoutsidetheUK,pleasevisitprojects.codeclubworld.org.Ourcurriculumisdeveloped
intheopenonGitHub(github.com/CodeClub),andweencouragecontributionsfromourcommunity-comeandjoinus!
2. Untickthevariablesothevalueisn’tshownonthemainstage
3. Createacustomblockcalledresetthatwillsetthespeedto0
atthestart
4. Createacustomblockcalledfallingthatwillmaketheobject
fallatthisspeed
13TheseprojectsareforuseinCodeClubswithintheUK.Forc lubsoutsidetheUK,pleasevisitprojects.codeclubworld.org.Ourcurriculumisdeveloped
intheopenonGitHub(github.com/CodeClub),andweencouragecontributionsfromourcommunity-comeandjoinus!
5. Createacustomblockcalledgravitythatwillmakeitspeedup
asitfalls,butstopwhenithitstheground
6. Createacustomblockcalledchooseobjecttypethatwill
chooseatypeofrubbish
14TheseprojectsareforuseinCodeClubswithintheUK.Forc lubsoutsidetheUK,pleasevisitprojects.codeclubworld.org.Ourcurriculumisdeveloped
intheopenonGitHub(github.com/CodeClub),andweencouragecontributionsfromourcommunity-comeandjoinus!
7. Createacustomblockcalledstartatthetopthatmakes
eachnewbitofrubbishstartatadifferentplace
8. Createacustomblockcallednewobjecteveryfourseconds
9. Bringitalltogetherbycreatingthefollowingscript
15TheseprojectsareforuseinCodeClubswithintheUK.Forc lubsoutsidetheUK,pleasevisitprojects.codeclubworld.org.Ourcurriculumisdeveloped
intheopenonGitHub(github.com/CodeClub),andweencouragecontributionsfromourcommunity-comeandjoinus!
TestYourProject
Clickthegreenflag.Thecatshouldstillbeabletorunaround,butnow
rubbishshouldrainfromthesky,spinningasitfalls.
Thingstotry
Step3:Carryingtherubbish
Nowwewanttomakethecattobeabletopickupfallenrubbishandcarryit.
ActivityChecklist
Selecttherubbishobjectsprite.
Createvariablesthatwillletusdescribethedifferentcostumesof
object
Saveyourproject
Trychangingnewobjecteveryfoursecondstomake
rubbishfallmoreorlessoften
Trychanginggravitytochangethespeedthatobjectsfall
1. Createanewvariable,forthisspriteonly,calledcan
2. Createanewvariable,forthisspriteonly,calledjar
3. Createanewvariable,forthisspriteonly,callednewspaper
4. Untickthemallsothey’renotshownonthestage
5. Modifytheexistingresetcustomblocksothatitlookslike
this.Thenumbersshouldmatchthecostumenumbersforthe
sprite.
16TheseprojectsareforuseinCodeClubswithintheUK.Forc lubsoutsidetheUK,pleasevisitprojects.codeclubworld.org.Ourcurriculumisdeveloped
intheopenonGitHub(github.com/CodeClub),andweencouragecontributionsfromourcommunity-comeandjoinus!
Createvariablestocontrolwhatthecatiscarrying
Controlhowobjectscanbecarried
1. Createanewvariable,forthisspriteonly,callednothing
2. Createanewvariable,forallsprites,calledcarrying
3. Untickthembothsothey’renotshownonthestage
4. Modifytheexistingresetcustomblock,toincludesettingboth
nothingandcarryingto4.Itshouldenduplookinglikethis.
1. Createanewcustomblockcalledwaittobecarriedthatlets
thecatpickupanobjectifit’snotalreadycarryingsomething.
Thiswillincludecreatinganeweventtobroadcastcarry-
17TheseprojectsareforuseinCodeClubswithintheUK.Forc lubsoutsidetheUK,pleasevisitprojects.codeclubworld.org.Ourcurriculumisdeveloped
intheopenonGitHub(github.com/CodeClub),andweencouragecontributionsfromourcommunity-comeandjoinus!
TestYourProject
Tryoutyourgameagain.
Thecatcancarryanitemofrubbish,andwilldropitwhenyoupressthe
spacebar.
change
2. Createanewscriptsoeachnewpieceofrubbishcanbe
carried
Saveyourproject
18TheseprojectsareforuseinCodeClubswithintheUK.Forc lubsoutsidetheUK,pleasevisitprojects.codeclubworld.org.Ourcurriculumisdeveloped
intheopenonGitHub(github.com/CodeClub),andweencouragecontributionsfromourcommunity-comeandjoinus!
Step4:Throwingtherubbish
Thenextstepisforthecattobeabletothrowtherubbishit’scarryinginto
theairinsteadofdroppingit.
ActivityChecklist
1. Createacustomblockcalledthrowintheair
2. Modifytheexistingwaittobecarriedblocksothatthecat
throwstheobjectinsteadofdroppingitwhenyoupressspace.
Itshouldenduplikethis.
19TheseprojectsareforuseinCodeClubswithintheUK.Forc lubsoutsidetheUK,pleasevisitprojects.codeclubworld.org.Ourcurriculumisdeveloped
intheopenonGitHub(github.com/CodeClub),andweencouragecontributionsfromourcommunity-comeandjoinus!
TestYourProject
Tryoutyourgameagain.
Thecatcancarryanitemofrubbish,andwillthrowitintheairwhenyou
pressthespacebar.Itwillfallbacktothegroundandcanbepickedup
again.
Step5:Creatingrecyclingbins
ActivityChecklist
Startbysettingupabackgroundforthebins.
Addbinstothebackground
Saveyourproject
1. ClickonStage
2. ClickontheBackdropstab
3. ClickonChoosebackdropfromlibraryandchoosea
backgroundlikeboardwalk
4. Deletetheoriginalblankbackdrop‘backdrop1’
1. ClickonConverttovector
2. ClickonImportontheBackdropstab
20TheseprojectsareforuseinCodeClubswithintheUK.Forc lubsoutsidetheUK,pleasevisitprojects.codeclubworld.org.Ourcurriculumisdeveloped
intheopenonGitHub(github.com/CodeClub),andweencouragecontributionsfromourcommunity-comeandjoinus!
Addlabelstothebins
3. ChooseResources/bin.png
4. ClickonSelect
5. Selectthebinandmoveandresizeittoputitonthe
boardwalkpath
6. Addtwomorebinssoitendsuplookingsomethinglikethis:
21TheseprojectsareforuseinCodeClubswithintheUK.Forc lubsoutsidetheUK,pleasevisitprojects.codeclubworld.org.Ourcurriculumisdeveloped
intheopenonGitHub(github.com/CodeClub),andweencouragecontributionsfromourcommunity-comeandjoinus!
Addthebinopenings
1. ClickonText
2. Addlabelstothebins-oneformetal,oneforglass,onefor
paper
1. ClickonPaintnewsprite
2. ClickontheCostumestab
3. ClickonConverttovector
4. Drawafilledovalthatmatchestheopeningforoneofthebins
5. Clickontheblue i andrenametheSpritetobin-can
6. Addascriptthatdrawsthebinbehindthrownrubbish
22TheseprojectsareforuseinCodeClubswithintheUK.Forc lubsoutsidetheUK,pleasevisitprojects.codeclubworld.org.Ourcurriculumisdeveloped
intheopenonGitHub(github.com/CodeClub),andweencouragecontributionsfromourcommunity-comeandjoinus!
Gettherubbishtogointhebins
7. Duplicatethesprite
8. Calltheduplicatebin-jar
9. Moveittocoverthesecondbinopening
10. Duplicatethespriteagain
11. Calltheduplicatebin-newspaper
12. Moveittocoverthethirdbinopening
1. Clickontheobjectsprite
2. Createanewcustomblockcalledrubbishbinned
3. Createanewcustomblockcalledgointhebin
23TheseprojectsareforuseinCodeClubswithintheUK.Forc lubsoutsidetheUK,pleasevisitprojects.codeclubworld.org.Ourcurriculumisdeveloped
intheopenonGitHub(github.com/CodeClub),andweencouragecontributionsfromourcommunity-comeandjoinus!
4. Modifytheexistingwaittobecarriedcustomblocksothat
thrownobjectscangointhebininsteadoffallingbackdown.
Itshouldenduplookinglikethis.
24TheseprojectsareforuseinCodeClubswithintheUK.Forc lubsoutsidetheUK,pleasevisitprojects.codeclubworld.org.Ourcurriculumisdeveloped
intheopenonGitHub(github.com/CodeClub),andweencouragecontributionsfromourcommunity-comeandjoinus!
TestYourProject
Tryoutyourgameagain.
Thecatcannowthrowitemsintobins.Itemswillonlygointothecorrect
bins,otherwisethey’llfallbackdownontotheground.
Step6:Keepscore
Saveyourproject
Createanewvariable,forallsprites,calledscore
Movethescorevariableinthestageupintothecorner
Modifythecustomresetblockinthescriptsfortherubbishobjectsto
resetthescoreto0,soitshouldlooklike:
Modifythecustomrubbishbinnedblocksothatitaddstothescore.It
shouldlooklike:
25TheseprojectsareforuseinCodeClubswithintheUK.Forc lubsoutsidetheUK,pleasevisitprojects.codeclubworld.org.Ourcurriculumisdeveloped
intheopenonGitHub(github.com/CodeClub),andweencouragecontributionsfromourcommunity-comeandjoinus!
TestYourProject
Tryoutyourgameagain.
Thecatgetsapointforeveryitemthatisputintothecorrectrecycling
bin.
Saveyourproject
Welldone,you’vefinished!Nowyoucanenjoyyourgame!
Don’tforgetyoucanshareyourgamewithallyourfriendsandfamilyby
clickingonShareonthemenubar!