scratch 2 clone wars · 2020. 3. 18. · codeclub.org.uk - if your club is not on the map then...

13
1 These projects are for use in Code Clubs within the UK. For clubs outside the UK, please visit projects.codeclubworld.org. Our curriculum is developed in the open on GitHub (github.com/CodeClub), and we encourage contributions from our community - come and join us! Activity Checklist Test your Project Save your Project All Code Clubs must be registered . Registered clubs appear on the map at codeclub.org.uk - if your club is not on the map then visit jumpto.cc/18CpLPy to find out what to do. Introduction In this project you’ll learn how to create a game in which you have to save the Earth from space monsters. Follow these INSTRUCTIONS one by one Click on the green flag to TEST your code Make sure to SAVE your work now Clone Wars Scratch 2

Upload: others

Post on 08-Feb-2021

0 views

Category:

Documents


0 download

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