Scratch Another computer programming language Developed by MIT in 2003 Written for 9-yr olds Version...

Preview:

Citation preview

Scratch

Another computer programming language Developed by MIT in 2003Written for 9-yr oldsVersion 2.0 (cloud-based) in 2013

http://scratch.mit.edu/Click on ‘Try it out’

Need a scratch account to save the work

Off-line editorhttp://scratch.mit.edu/scratch2download/

Tutorialwww.cs.uml.edu/~kim/100/Scratch_tutorial.pdf

Scratch Screen

Stage

Sprite: characters and elements appearing in stage

Blocks palette

Script

Scratch Blocks Motion (blue)

Looks (purple): manage sprite apprearnaces

Sound (pink)

Pen (green): control drawing pen

Data (orange): store and display variable data

Events (brown)

Control (gold)

Sensing (light-blue): detect digital/analog inputs

operators

Costumes & BackdropsUsed to simulate animation

Each sprite has at least one costume

Freely can edit and/or add costumes

Add a new costumeCostume menuDraw your own

Backdrop Click on Stage in lower leftBackdrop menu

Motion

Look through the list of Motion scriptsMoveTurnglide

Events

Look through possible eventsWhen flag clickedWhen xxx key pressedWhen sprite clicked….

Control

ControlsRepeats (finite or forever) if. .. then .. elsewait untilrepeat until

Looks

LooksAdd wordsSwitch costumesSwitch backdropsChange colorChange size

Sensing

Events about interactionsWhen touching another object Is a xxx key presseddistance ?Loudness ?

LAB Add Lightening Bolt sprite Add costumes, Buttefly-a and –b to Cat sprite Set backdrop to brick wall1

Drag “when flag is clicked” Script pane Set Cat sprite at (-160, -120)

LAB (cont’d) Have Cat walk to the right until it hits

on the Lightening Bolt

When the Lightening strikes, change to butterfly and fly away

LAB (cont’d)

Set Lightening Bolt at (-10, -20) Position the Lightning Bolt sprite at (-5,

-20)

Recommended