Skip to content

Please update your browser

Your browser version is not supported by this site. CS First may not work properly. Learn more

7. Conditionals in the World Around You

  • 1. Introduction to Graffiti
  • 2. Moving and Stamping
  • 3. Check a Condition
  • 4. Fixing the Bug
  • 5. Add-Ons
  • 6. Reflection
  • 7. Conditionals in the World Around You
  • 8. Wrap-up: Share Your Project
  • 9. Wrap-up: Show Your Project
arrow_backward Back Next arrow_forward
Transcript

In today’s project, you explored the “if/then” block in Scratch and used it to build an interactive graffiti project. “If” statements are a type of logic that helps computers make decisions. Today, you programmed a sprite to make a decision based on whether or not the mouse button was pressed down.

Computer scientists like you use “if” statements all the time in their code. Any interactive app requires conditionals. For example, in Angry Birds, if the player touches the screen, then the bird is positioned to launch. If the player stops touching the screen, then the bird is released!

In Fruit Ninja, if the player swipes a piece of fruit, then the fruit is destroyed.

Many apps and games also have winning conditions. A winning condition is an if/then statement used specifically to tell if someone has won the game. For example, in Candy Crush, if a player reaches the target score, then they complete the level and win!

In the next CS First club, you will use more conditionals to make a “Shadow maker” similar to a photo editor you could find on Instagram!

Until then, have fun creating and coding!

Instructions
  1. Write a G+ shout-out!