1 / 18

Scratch Programming

Scratch Programming. Session 6 of 10 If-then-else statements interactions Final projects specifications. Objectives for Session 6. If Statement If Else Statement Interaction. If Statement. If you are 12, raise your hand If you like baseball, stand up. If Statement Programming View.

axl
Download Presentation

Scratch Programming

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  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 True or false test Statements to do only if test is true • The If Statement • Located in the Control Menu

  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

More Related