Download presentation
Presentation is loading. Please wait.
1
Scratch Programming Session 6 of 10 If-then-else statements interactions Final projects specifications
2
Objectives for Session 6 If Statement – If Else Statement Interaction
3
If Statement If you are 12, raise your hand If you like baseball, stand up
4
If Statement Programming View If ( you are 12) { raise your hand } If ( you like baseball) { stand up }
5
If Statement Scratch View The If Statement – Located in the Control Menu True or false test Statements to do only if test is true
6
If Statement Practice Let’s create an If Statement Create a variable A Set A to 0 Create an If Statement If A > 2 Perform some Motion Change A to 3
7
If Statement Practice Try creating the following If Statement on your own If ( A = B ) { Move 5 steps }
8
If Else Statement If you like football, raise your hand Else stand up If you are 11, go to the right side of the room Else go to the left side of the room
9
If Else Statement If ( you are 11 ) { raise your hand } Else { stand up }
10
If Else Statement Practice Loop forever If the mouse is clicked – Move 10 steps Else – Turn 15 degrees
11
If Else Statement Practice Create your own If Else Statement
12
Interaction Between two Sprites Examples – When two Sprites are touching – When one Sprite is clicked by mouse
13
Interaction Example Start with a blank screen Create another Sprite Make sure your cat is facing the first Sprite
14
Interaction Example cont. Add this in for the cat When space bar clicked If touching Sprite2 – Say hello Else – Move 10 steps
15
Interaction Example cont. Add this in for the second Sprite When space bar clicked If touching Sprite1 – Say I’m standing here
16
Interaction Practice Create your own example Using Two or Three Sprites Use touching
17
Review You now know: – How to create an If Statement – How to create an If Else Statement – How to sense touching other Sprites
18
Final Project Create a story, a lesson, a game, or a simulation Use at least two sprites that interact in some way Use at least two scenes and backgrounds Use some sound and motion Have some properties change, such as size or color, or shape
Similar presentations
© 2024 SlidePlayer.com Inc.
All rights reserved.