Intro to Programming with Scratch - Preiented By: Joseph Odhiambo PAGE 1
Class Rules Please stay mute unless you are told not to. If you have a question, please use the raise hand function. There will be a rewarding system. I’ll keep track of each group’s points and the winning group will get a reward after each lesson. PAGE 2
Let’s introduce yourself to your new friends PAGE 3
What is programming?- Is writing instruction to a computer to complete a task. And where is it used PAGE 4
What is Scratch? PAGE 5 And what can you do with it ?
Structure of a Scratch Program PAGE 10 Layers: Character Background
Structure of a Scratch Program PAGE 11 Layers: Characters Costume Code Background Paint Code
Exercise: PAGE 12 Change the background Change the costume with a line of code
Repeat PAGE 13
How to make the kitten run? (Simulate human’s motion of running) PAGE 14
It might be hard to simulate this movement all at once. PAGE 15 Can we break this into small pieces? But…
2 Step Process: Move your left leg forward Move your right leg forward Repeat this process again and again PAGE 16
How to achieve this process through code? PAGE 17
2 Step Process: Costume 1 Costume 2 Repeat this process again and again PAGE 18
Let’s try it out PAGE 19
Naïve approach: PAGE 20 Does it work? Why?
Computer Programs are very fast PAGE 21 Fast enough that your eyes cannot capture
Second approach: PAGE 22 Does it work? Why?
Can only repeat a certain number of times Unable to control the exact stopping time PAGE 23
Third approach: PAGE 24 Which one is better?
How to improve even more? PAGE 25
Final approach: PAGE 26
Exercise: Can you make the bear walk? PAGE 27
Challenge: PAGE 28 Imagine that I’m shooting a basketball. Can you simulate the motion of the ball? It does not just fly in a straight line! It also rotates.
More Challenge: PAGE 29 Can you control the ball’s movement using arrow keys while keeping it rotating