Upload
edwin-murphy
View
221
Download
1
Tags:
Embed Size (px)
Citation preview
IntroducingScratch the Cat
Shapes and Colors
Computer Programs
• Tell the computer what to do
• Without Programs – Computers do nothing
• Computer Programmers write the programs that make our computers do stuff
Scratch
• Scratch is a way to write computer programs–We can tell Scratch what to do
–We have to be very specific
–We have to be very exact
–We have to be very complete
Open Scratch
• Lets look at a program that tells Scratch to draw shapes
• Double-Click on the File Named: SHAPES.SB
You Should See This:
Draw a Square
• Lets See Scratch Draw A Square• Click on the Green Flag
Draw a Square
• Hit the “S” key • Watch Scratch Draw a Square
Draw a Square
• How did we get Scratch to Draw a Square???
• How do you draw a Square?
• We need to “tell” Scratch the same thing in our computer program
Program
• Look at the Middle Block in Scratch• Code - Instructions
Drawing a Square- Instructions
Key to Press
Drawing a Square- Instructions
Color
Drawing A Square - Instructions
Sides
Drawing A Square - Instructions
Size
Drawing A Square - Instructions
How to Turn
Change Square - Color
See the Color – Click on this Box
Change Square - Color
Change the Color
Change Square - Color
Pick ANY Color
Draw a Square
• Hit the “S” key again• Watch Scratch Draw a Square in Your
Color
Need to Start Over
STOP
Need to Start Over
Start Over
Change Square - Size
See the Size – Click on this Box
Change Square - Size
Change the Size
Change Square - Size
Type A New Number
Draw a Square
• Hit the “S” key again• Watch Scratch Draw a Square with
the New Size
Drawing A Different Square - Sides
4 Sides in a Square
Drawing A Different Square - Sides
Change Number
Draw a Square
• Hit the “S” key again• Watch Scratch Draw a Square with
more or less sides
6 Sides
Drawing A Different Square – Sides – Put Back to 4
Put Back to 4
Drawing A Different Square – How to Turn
Amount to Turn
Drawing A Different Square – How to Turn
Change Number
Draw a Square
• Hit the “S” key again• Watch Scratch Draw a Square?
150
Drawing A Different Square – Turn – Put Back to 90
Put Back to 90
Program Does More
• Look at the Middle Block in Scratch• Code - Instructions
What Does this Do?
• Key Clicked?• Sides?
Draw The Shape
• Hit the “T” key • Watch Scratch Draw The Shape• Were you Right?
Make Some Changes?
ColorSize
Turns
Draw The Triangle Again
• Hit the “T” key • Watch Scratch Draw The Shape• See Your Changes?
Program Does More
• Look at the Middle Block in Scratch• Code - Instructions
What Does this Do?
• Key Clicked?• Sides?–Why is this
different–What is it doing?
Draw The Shape
• Hit the “R” key • Watch Scratch Draw The Shape• Were you Right?
Make Some Changes?
• Have to change in more than 1 place
ColorSize
Turns
Draw The Rectangle Again
• Hit the “R” key • Watch Scratch Draw The Shape• See Your Changes?
Program Does More
• Look at the Middle Block in Scratch• Code - Instructions
Lets Make Our Own
• Lets see what it takes to write our own program to tell the computer to draw a line:
• Click “FILE”
FILE
Lets Make Our Own
• Click on “NEW”
NEW
Lets Make Our Own
• Save Current Project:• Click “YES:
YES
New Program
Change Cat
• Lets use a different animal • Click
Delete Scratch
• Click Scratch
Pick a New Animal
• New – Click
Middle Star
Pick a New Animal
• New – Click “Animals” Folder
Animals
Pick a New Animal
• Click on any Animal• Can Scroll UP and DOWN
Animals
Scroll
Pick a New Animal
• Click: OK
OK
Pick a New Animal
• New Animal
Give Instructions
• Buttons Sort Instructions
Start
• Click ORANGE button: CONTROL
CONTROL
Flag (GO)
• Click on Flag
Flag
Flag (GO)
• Drag Flag to Middle
Flag
Flag (GO)
• Drag Flag to Middle
Drag to Middle
Start in Middle of Screen
• Click Blue Button: MOTION
Motion
Start in Middle of Screen
• Click on • Drag to Middle
Motion
Go To X:_ Y:_
Start in Middle of Screen
• Connect to Flag
Click to Flag
Start in Middle of Screen
• Change 10s to 0s
Change to 0
Start in Middle of Screen
• Change 10s to 0s
Change to 0
Line – Color / Width
• Click Green Button - PEN
Pen
Line – Clear
• Drag to Middle
CLEAR
Line – Color
• Connect To List
Connect to List
Line – Color
• Drag to Middle
Pen
Line – Color
• Connect To List
Connect to List
Line – Pick Color
• Click on the Box
Click BOX
Click BOX
Line – Pick Color
• Pick any Color
Click Color
Line – Size
• Drag to Middle
Set Pen Size
Line – Size
• Connect to List
Connect
Line – Size
• Change Size Change
Change to 15
Write Line
• Click• Drag to Middle• Connect to List
Pen Down
Put in List
Say Hello
• Make it Say Hello• Click on Dark Purple: LOOKS
LOOKS
Say Hello
• Click• Drag to Middle• Connect to List
Say HelloConnect
Test It
• Test – See if it works• Click
Green Flag
Test It
Test It
• No Line? Why?
Draw Line
• Click Blue: MOTION
Motion
Draw Line
• Click• Drag to Middle• Connect to List
Move 10 Steps
Connect to List
Draw Long Line
• Change Line from 10 to 150• Change to
• To 150
150
Test It
• Try It• Click
Code - Instructions
• What Can You Change?• How?