Download presentation
Presentation is loading. Please wait.
1
Learn… Create… Program
2
What is Scratch? Scratch is a free programmable toolkit that enables kids to create their own games, animated stories, and interactive art share their creations with one another over the Internet. © Educational Technology Department, Group Head Office, The City School.
3
What is Scratch? Scratch builds on the long tradition of Logo and LEGO/Logo, but takes advantage of new computational ideas and capabilities to make it easier for kids to get started with programming (lowering the floor) and to extend the range of what kids can create and learn (raising the ceiling). © Educational Technology Department, Group Head Office, The City School.
4
What is Scratch? The ultimate goal is to help kids become fluent with digital media, empowering them to express themselves creatively and make connections to powerful ideas. © Educational Technology Department, Group Head Office, The City School.
5
What is Scratch? Increase student skills with computers
Increase student interest in programming Student achievement on fun project Learn Cartesian coordinates, distance computations, etc. © Educational Technology Department, Group Head Office, The City School.
6
Computer scientists Create solutions to problems using computers
Study information Invent algorithms Write programs to implement the algorithms Reuse a lot of existing program and machine parts © Educational Technology Department, Group Head Office, The City School.
7
Start scratch and let’s go!
Click on the cat icon Or, find “scratch” under “Programs” When home, download from Scratch programming environment comes up quickly © Educational Technology Department, Group Head Office, The City School.
8
Click on the “Looks” button at the top left.
© Educational Technology Department, Group Head Office, The City School.
9
Major components At right: the stage with sprite[s] or objects or actors At left: operations and attributes for the sprites Center: scripts or program[s] for the behavior[s] of the sprites Your sprites are actors that you direct with your scripts © Educational Technology Department, Group Head Office, The City School.
10
Let’s implement an algorithm to average two numbers
Make a variable “number1” (click and drag and set) Make another one “number2” © Educational Technology Department, Group Head Office, The City School.
11
Compute average first as sum
Make variable average Drag a “set operation” to script area Drag a + operation Drag variables number1 and number2 to parameters Click to execute © Educational Technology Department, Group Head Office, The City School.
12
Average script as 4 operation sequence.
Change the two numbers and click the sequence to execute the block again. © Educational Technology Department, Group Head Office, The City School.
13
But Scratch computes with multimedia – color, sound, …
Can make cartoons Can create stories Can create video games © Educational Technology Department, Group Head Office, The City School.
14
The “hello” script Can do it in 57 languages – java, C++, … Scratch
Easy in Scratch: select “Looks” operations and drag the “hello operation” onto your center panel. Then double click on this “lego block”: check your sprite behavior at the right Your very first Scratch program! © Educational Technology Department, Group Head Office, The City School.
15
Make the cat 50% larger Select “Looks” operations
Drag the “change size” operator into your script Click and edit for a 50% change (increase) Double click your one operation script Did your cat sprite get 50% bigger? © Educational Technology Department, Group Head Office, The City School.
16
Scripting a sequence of ops
Do ops in the following order by dragging operation blocks into a single connected block Say hello Move 200 steps forward Grow 50% bigger Make the “meow sound” © Educational Technology Department, Group Head Office, The City School.
17
Some new operations wait (Control) move (Motion) color change (Looks)
© Educational Technology Department, Group Head Office, The City School.
18
Starting a looped script
© Educational Technology Department, Group Head Office, The City School.
19
Exercise: write a script to
Make the cat move along a square path Say “hi” at all four corners Wait 3 seconds at each corner Change color at all four corners Double size when back to the original starting location. Say “That’s all folks” when done. © Educational Technology Department, Group Head Office, The City School.
20
Elements of Scratch: objects
Colors Sounds Locations in 2D space Sprites Costumes Variables (to remember the state of things) Events: that are broadcast for communication © Educational Technology Department, Group Head Office, The City School.
21
Elements of Scratch: control
Sequence of operations Loops or repetition Detecting events (key or mouse pressed, sprites overlapping each other, sprites hitting edge of stage, sensor giving value) © Educational Technology Department, Group Head Office, The City School.
22
Loop constructs in Scratch
Repeat N times Repeat forever Repeat forever if some condition exists (suppose I’m a sprite wandering about this lab until someone asks a question) © Educational Technology Department, Group Head Office, The City School.
23
Conditions can be checked
Do something if sprite k hits sprite m Do something if a certain key is pressed Do something is some variable takes a certain value © Educational Technology Department, Group Head Office, The City School.
24
Interacting with your sprite or story
Using mouse Entering a character Asking the user a question © Educational Technology Department, Group Head Office, The City School.
25
Sprite follows the mouse
Try changing the number of steps or the wait time. © Educational Technology Department, Group Head Office, The City School.
26
Play and examine MadLib
Choose the “file” option at the top of the window Choose “open”, then “examples” Choose “stories” Choose “MadLib” and then read the authors instructions Click OK, wait for load, click green flag © Educational Technology Department, Group Head Office, The City School.
27
About the MadLib story How many actors (sprites)?
What is the role of the girl? How are the answers you give 'remembered' and then used in later actions? What is the role of the little whale? What makes the little whale flip around? What makes the big whale spout? © Educational Technology Department, Group Head Office, The City School.
28
Sprites can interact with each other
Can detect when colors overlap in space Can detect when sprites bump into edge of the stage See “bouncing balls” example under Simulations under Examples Interact with this simulation Check out the rather complex scripts © Educational Technology Department, Group Head Office, The City School.
29
Check out the break dance
Open examples; music and dance; break dance How does break dancing begin? What are the roles of the sprites? What events are in the scripts? What should happen when the boom box is clicked? © Educational Technology Department, Group Head Office, The City School.
30
Experiment with Scratch as time permits
Try your own scripts: make moves, sounds, interactions in simple cases Try the examples and learn what makes them work Download Scratch on your own machine and experiment some more Direct a story; or a simulation; or create a video game. © Educational Technology Department, Group Head Office, The City School.
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.