16

What are the different scratch blocks?

Embed Size (px)

Citation preview

Page 1: What are the different scratch blocks?
Page 2: What are the different scratch blocks?

Sprites• Every object is a sprite

• Two cats = two sprites• Sprites have:

• Scripts (how the script ‘behaves’)• Costumes (what the sprite looks like)

Page 3: What are the different scratch blocks?

Stage• Where all sprites are placed• The stage can also have scripts

• Useful when scripts aren’t specific to an actual sprite

• Instead of costumes, has backdrops

Page 4: What are the different scratch blocks?

creating scripts: entry point

• Begin the program with pressing the green flag

Page 5: What are the different scratch blocks?

statements• Where the action is

Page 6: What are the different scratch blocks?

booleans, conditions• Ask a true/false

question…• …And do

something based on the answer.

Page 7: What are the different scratch blocks?

conditions{a fork in the road}

Page 8: What are the different scratch blocks?
Page 9: What are the different scratch blocks?

loops• Used to repeat statements:

• Continuously

• For a set number of times

• Until a certain condition is true

Page 10: What are the different scratch blocks?

loops: avoid this

Page 11: What are the different scratch blocks?

much better!

Page 12: What are the different scratch blocks?

variables• Contain values

• In Scratch: Numbers and words

Page 13: What are the different scratch blocks?

variables: scope• Global (stage + all sprites)• Local (one sprite only)• Who needs to use the variable?

Page 14: What are the different scratch blocks?

events• How the sprite behaves when…

Page 15: What are the different scratch blocks?

broadcasting events• Allows sprites to communicate• Signal an event:• Handle an event:

Page 16: What are the different scratch blocks?

threads• Simultaneous processes