Computing Year 7 - Unit 2 Programming Basics Scratch Basics
Today’s Objectives 1 Know how to use blocks in scratch to give execute instructions 2 Know the first of our ‘Big 3’ - sequencing 3 Know that sequencing is about placing instructions in the correct order 4 Know how to debug – test a program Practical Tasks: Make some basic programs
Sprite Blocks Instructions Test & Debug Stage
Stage Drawers Script Blocks
Stage - coordinates 180 +y -240 240 -x +x 0,0 -y -180 10/11/17 Scratch - Programming 180 x= y= 180 x= y= -240 x= y= +y 240 x= y= x= y= -180 -240 240 -x +x Stage coordinates 0,0 -y -180
Algorithm - Script Move forward then backwards Move forward 4 steps Instructions have to be more precise Move forward 4 steps Wait 2 s Move backward 4 steps
Different instructions giving a same output Test & Debug Events Control Motion Move forward 100 steps Wait 1 s Move backward 100 steps Different instructions giving a same output
D C A B Algorithm - Script Rules: Don’t change the sprite When the sprite is clicked, start in the centre move to A and back. Do the same for B, C and D D Rules: Don’t change the sprite Don’t change the background C A B
Big 3
“explain the code and problem to the duck “explain the code and problem to the duck. This can help with de-bugging”
Sequencing Challenges Make Scratch cat jump up and down when is pressed. Make scratch cat say ‘meow’ wait for a bit and then walk to left edge of the stage when key is pressed. Make Scratch cat say ‘I’m growing’ and grow from normal size to 200% in stages when the key is pressed. Make one up… for [1] [2] [3] [4]
Challenge [1] Make Scratch cat jump up and down when is pressed. A B C D https://scratch.mit.edu/projects/188674534/
Challenge [2] Make scratch cat say ‘meow’ wait for a bit and then walk to the left edge of the stage when key is pressed. A B C https://scratch.mit.edu/projects/188674534/
Challenge [3] Make Scratch cat say ‘I’m growing’ and grow from normal size to 200% in stages when the key is pressed. A B C https://scratch.mit.edu/projects/188674534/
Big 3
Today’s Objectives 1 Know how to use blocks in scratch to give execute instructions 2 Know the first of our ‘Big 3’ - sequencing 3 Know that sequencing is about placing instructions in the correct order 4 Know how to debug – test a program Practical Tasks: Make some basic programs