Scratch Another computer programming language Developed by MIT in 2003 Written for 9-yr olds Version 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 editor http://scratch.mit.edu/scratch2download/ Tutorial www.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 & Backdrops Used to simulate animation Each sprite has at least one costume Freely can edit and/or add costumes Add a new costume Costume menu Draw your own Backdrop Click on Stage in lower left Backdrop menu
Motion Look through the list of Motion scripts Move Turn glide
Events Look through possible events When flag clicked When xxx key pressed When sprite clicked ….
Control Controls Repeats (finite or forever) if. .. then .. else wait until repeat until
Looks Looks Add words Switch costumes Switch backdrops Change color Change size
Sensing Events about interactions When touching another object Is a xxx key pressed distance ? 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)