Download - Scratch 1 Lost in Space · 2016-06-02 · also add the ‘Stars’ backdrop to your stage. ... Let’s add monkey to your animation, who’s lost in space! Activity Checklist Start

Transcript
Page 1: Scratch 1 Lost in Space · 2016-06-02 · also add the ‘Stars’ backdrop to your stage. ... Let’s add monkey to your animation, who’s lost in space! Activity Checklist Start

1©RaspberryPiFoundation.UKRegisteredCharity1129409.TheseprojectsareforuseoutsidetheUKonly.Moreinformationatwww.codeclubworld.org.

ThiscourseworkisdevelopedonGitHub,atwww.github.com/CodeClub.

ActivityChecklist

TestyourProject

SaveyourProject

AllCodeClubsmustberegistered.Byregisteringyourclubwecanmeasureourimpact,andwecancontinuetoprovidefreeresourcesthathelpchildrenlearntocode.Youcanregisteryourclubatcodeclubworld.org.

IntroductionYouaregoingtolearnhowtoprogramyourownanimation!

FollowtheseINSTRUCTIONSonebyone

ClickonthegreenflagtoTESTyourcode

MakesuretoSAVEyourworknow

LostinSpaceScratch

1

Page 2: Scratch 1 Lost in Space · 2016-06-02 · also add the ‘Stars’ backdrop to your stage. ... Let’s add monkey to your animation, who’s lost in space! Activity Checklist Start

2©RaspberryPiFoundation.UKRegisteredCharity1129409.TheseprojectsareforuseoutsidetheUKonly.Moreinformationatwww.codeclubworld.org.

ThiscourseworkisdevelopedonGitHub,atwww.github.com/CodeClub.

Step1:Animatingaspaceship

Let’smakeaspaceshipthatfliestowardstheEarth!

ActivityChecklist

StartanewScratchproject,anddeletethecatspritesothat

yourprojectisempty.YoucanfindtheonlineScratcheditor

atjumpto.cc/scratch-new.

Add‘Spaceship’and‘Earth’spritestoyourstage.Youshould

alsoaddthe‘Stars’backdroptoyourstage.Thisishowyour

stageshouldlook:

Clickonyournewspaceshipsprite,andclickthe‘Costumes’

tab.

Page 3: Scratch 1 Lost in Space · 2016-06-02 · also add the ‘Stars’ backdrop to your stage. ... Let’s add monkey to your animation, who’s lost in space! Activity Checklist Start

3©RaspberryPiFoundation.UKRegisteredCharity1129409.TheseprojectsareforuseoutsidetheUKonly.Moreinformationatwww.codeclubworld.org.

ThiscourseworkisdevelopedonGitHub,atwww.github.com/CodeClub.

Usethearrowtooltoselecttheimage.Thenclickonthe

circularrotatehandle,androtatetheimageuntilitisonits

side.

Addthiscodetoyourspaceshipsprite:

Changethenumbersinthecodeblocks,sothatthecodeis

Page 4: Scratch 1 Lost in Space · 2016-06-02 · also add the ‘Stars’ backdrop to your stage. ... Let’s add monkey to your animation, who’s lost in space! Activity Checklist Start

4©RaspberryPiFoundation.UKRegisteredCharity1129409.TheseprojectsareforuseoutsidetheUKonly.Moreinformationatwww.codeclubworld.org.

ThiscourseworkisdevelopedonGitHub,atwww.github.com/CodeClub.

exactlythesameasintheimageabove.

Ifyouclickonthecodeblockstorunthecode,youshouldsee

thespaceshipspeak,turnandmovetowardsthecentreofthe

stage.

Thescreenposition x:(0)y:(0) isthecenterofthestage.A

positionlike x:(-150)y:(-150) istowardsthebottom-leftof

thestage,andapositionlike x:(150)y:(150) isnearthetop-

right.

Page 5: Scratch 1 Lost in Space · 2016-06-02 · also add the ‘Stars’ backdrop to your stage. ... Let’s add monkey to your animation, who’s lost in space! Activity Checklist Start

5©RaspberryPiFoundation.UKRegisteredCharity1129409.TheseprojectsareforuseoutsidetheUKonly.Moreinformationatwww.codeclubworld.org.

ThiscourseworkisdevelopedonGitHub,atwww.github.com/CodeClub.

Ifyouneedtoknowthecoordinatesofapositiononthestage,

movethemousetothepositionyouwantandmakeanoteof

thecoordinates,whicharedisplayedbelowthestage.

Tryoutyouranimation,byclickingonthegreenflagjustabove

thestage.

Page 6: Scratch 1 Lost in Space · 2016-06-02 · also add the ‘Stars’ backdrop to your stage. ... Let’s add monkey to your animation, who’s lost in space! Activity Checklist Start

6©RaspberryPiFoundation.UKRegisteredCharity1129409.TheseprojectsareforuseoutsidetheUKonly.Moreinformationatwww.codeclubworld.org.

ThiscourseworkisdevelopedonGitHub,atwww.github.com/CodeClub.

Challenge:Improvingyouranimation

Canyouchangethenumbersinyouranimationcode,sothat:

You’llneedtochangethenumbersinthisblock:

ThespaceshipmovesuntilittouchestheEarth?

ThespaceshipmovesmoreslowlytowardstheEarth?

Saveyourproject

Page 7: Scratch 1 Lost in Space · 2016-06-02 · also add the ‘Stars’ backdrop to your stage. ... Let’s add monkey to your animation, who’s lost in space! Activity Checklist Start

7©RaspberryPiFoundation.UKRegisteredCharity1129409.TheseprojectsareforuseoutsidetheUKonly.Moreinformationatwww.codeclubworld.org.

ThiscourseworkisdevelopedonGitHub,atwww.github.com/CodeClub.

Step2:Animatingusingloops

Anotherwayofanimatingthespaceshipistotellittomoveasmallamount,

lotsoftimes.

ActivityChecklist

Deletethe glide blockfromyourcode,byright-clickingon

theblockandclicking‘delete’.Youcanalsodeletecodeby

draggingitoffthescriptarea,backintothecodeblocksarea.

Onceyou’veremovedyourcode,addthiscodeinstead:

The repeat blockisusedtorepeatsomethinglotsoftimes,

andisalsoknownasaloop.

Ifyouclicktheflagtotryoutthisnewcode,you’llseethatit

doesprettymuchthesamethingasbefore.

Page 8: Scratch 1 Lost in Space · 2016-06-02 · also add the ‘Stars’ backdrop to your stage. ... Let’s add monkey to your animation, who’s lost in space! Activity Checklist Start

8©RaspberryPiFoundation.UKRegisteredCharity1129409.TheseprojectsareforuseoutsidetheUKonly.Moreinformationatwww.codeclubworld.org.

ThiscourseworkisdevelopedonGitHub,atwww.github.com/CodeClub.

Youcanaddmorecodetoyourloop,todointerestingthings.

Addthe changecoloreffectby25 blockintotheloop(from

the‘Looks’section),torepeatedlychangethecolourofthe

spaceshipasitmoves:

Clicktheflagtoseeyournewanimation.

Youcanalsomakeyourspaceshipgetsmallerasitmoves

towardstheEarth.

Page 9: Scratch 1 Lost in Space · 2016-06-02 · also add the ‘Stars’ backdrop to your stage. ... Let’s add monkey to your animation, who’s lost in space! Activity Checklist Start

9©RaspberryPiFoundation.UKRegisteredCharity1129409.TheseprojectsareforuseoutsidetheUKonly.Moreinformationatwww.codeclubworld.org.

ThiscourseworkisdevelopedonGitHub,atwww.github.com/CodeClub.

Testoutyouranimation.Whathappensifyouclicktheflaga

secondtime?Doesyourspaceshipstartofftherightsize?

Canyouusethisblocktofixyouranimation:

Saveyourproject

Page 10: Scratch 1 Lost in Space · 2016-06-02 · also add the ‘Stars’ backdrop to your stage. ... Let’s add monkey to your animation, who’s lost in space! Activity Checklist Start

10©RaspberryPiFoundation.UKRegisteredCharity1129409.TheseprojectsareforuseoutsidetheUKonly.Moreinformationatwww.codeclubworld.org.

ThiscourseworkisdevelopedonGitHub,atwww.github.com/CodeClub.

Step3:FloatingMonkey

Let’saddmonkeytoyouranimation,who’slostinspace!

ActivityChecklist

Startbyaddinginthemonkeyspritefromthelibrary.

Ifyouclickonyournewmonkeyspriteandthenclick

‘Costumes’,youcanedithowthemonkeylooks.Clickthe

‘Ellipse’tool,anddrawawhitespacehelmetaroundthe

monkey’shead.

Page 11: Scratch 1 Lost in Space · 2016-06-02 · also add the ‘Stars’ backdrop to your stage. ... Let’s add monkey to your animation, who’s lost in space! Activity Checklist Start

11©RaspberryPiFoundation.UKRegisteredCharity1129409.TheseprojectsareforuseoutsidetheUKonly.Moreinformationatwww.codeclubworld.org.

ThiscourseworkisdevelopedonGitHub,atwww.github.com/CodeClub.

Nowclick‘Scripts’,andaddthiscodetothemonkey,sothatit

spinsslowlyinacircleforever:

The forever blockisanotherloop,butthistimeonethat

neverends.

Clicktheflagtotestyourmonkey.You’llhavetoclickthestop

button(nexttotheflag)toendthisanimation.

Page 12: Scratch 1 Lost in Space · 2016-06-02 · also add the ‘Stars’ backdrop to your stage. ... Let’s add monkey to your animation, who’s lost in space! Activity Checklist Start

12©RaspberryPiFoundation.UKRegisteredCharity1129409.TheseprojectsareforuseoutsidetheUKonly.Moreinformationatwww.codeclubworld.org.

ThiscourseworkisdevelopedonGitHub,atwww.github.com/CodeClub.

Step4:BouncingAsteroids

Let’saddsomefloatingspace-rocktoyouranimation.

ActivityChecklist

Adda‘rock’spritetoyouranimation.

Addthiscodetoyourrock,tomakeitbouncearoundthe

stage:

Clicktheflagtotestyourrock.Doesitbouncearoundthe

stage?

Page 13: Scratch 1 Lost in Space · 2016-06-02 · also add the ‘Stars’ backdrop to your stage. ... Let’s add monkey to your animation, who’s lost in space! Activity Checklist Start

13©RaspberryPiFoundation.UKRegisteredCharity1129409.TheseprojectsareforuseoutsidetheUKonly.Moreinformationatwww.codeclubworld.org.

ThiscourseworkisdevelopedonGitHub,atwww.github.com/CodeClub.

Step5:ShiningStars

Let’scombineloopstomakeashiningstar.

ActivityChecklist

Adda‘star’spritetoyouranimation

Addthiscodetoyourstar:

Clicktheflagtotestoutthisstaranimation.Whatdoesthis

codedo?Well,thestarismadeslightlybigger20times,and

thenmadeslightlysmaller20times,backtoit’soriginalsize.

These2loopsareinsidea forever loop,sotheanimation

keepsrepeating.

Saveyourproject

Page 14: Scratch 1 Lost in Space · 2016-06-02 · also add the ‘Stars’ backdrop to your stage. ... Let’s add monkey to your animation, who’s lost in space! Activity Checklist Start

14©RaspberryPiFoundation.UKRegisteredCharity1129409.TheseprojectsareforuseoutsidetheUKonly.Moreinformationatwww.codeclubworld.org.

ThiscourseworkisdevelopedonGitHub,atwww.github.com/CodeClub.

Challenge:Makeyourownanimation

Stopyourspaceanimation,andclick‘File’andthen‘New’,to

startanewproject.

Usewhatyou’velearntinthisprojecttomakeyourown

animation.Itcanbeanythingyoulike,buttrytomakeyour

animationmatchthesetting.Herearesomeexamples:

Saveyourproject