Uploaded by Nora LaCasse

1.06 Getting Started with Conditionals

advertisement
Getting Started w/ Conditionals
During tomorrow’s class, we’ll start thinking about how we can make our programs interactive with the
use of conditional statements. We’ll look at specifics tomorrow, and we’ll use the rest of our time today
to begin testing them out and tinkering with them.
Directions: Choose one of the options below to spend some time playing with conditional statements
1. Freestyle! Use this time to play with using conditional statements in whatever way you want
2. Semi-freestyle. Test out each of the different “sensing” blocks that fit in the empty hexagonal
space in the conditional statement block. You decide what you want to happen in each
conditional.
3. Guided. Use conditional statements to try and make the following things happen:
 IF your sprite is touching the mouse, it jumps away
 Put a few different colored sprites on the stage. IF your sprite is touching any of those
colors, it announces the color.
 IF the mouse is clicked anywhere on the stage, your sprite should say “click” (or
whatever you want)
 Bring out the IF/ELSE block. Play with this and see if you can figure out how it works.
 Try playing around with nested conditional statements (a conditional statement within a
conditional statement). Can you use this to make it so that if you click ON THE SPRITE,
something happens. It’s not too tricky to make something happen if you touch the sprite
with the cursor, OR if you click anywhere, but making them BOTH happen at the same
time is a LITTLE trickier.
Download