Lesson 21 Tasks
- Get the joystick from the supply bin by dragging it
- When using a new object in Etoys, look for new categories in its viewer.
- The are several new variables in the "joystick" category.
- A great way to learn in Etoys is to simply experiment.
- The left right variable goes from -5 to 5 indicating left & right motion.
- The up down variable goes from -5 to to indication up & down motion.
- So far, we've used forward-by and turn-by to do motion.
- You can change a sketch's x and y variables to move them explicitly.
- As you increase y, the sketch goes up.
- As you increase x, the sketch goes right.
- Read the left-pointing arrow as "becomes", as in "Seymour's X becomes 100".
- Click the left-pointing arrow to choose "increase by" instead of "becomes".
- We want to increase the x and y by whatever the joystick is currently doing.
- To use just variable, drag by its name, not the white arrow.
- Drop the joystick's left right variable next to "x increase by".
- Drop the joystick's up down variable next to "y increase by".
- The joystick is a little sluggish since it only moves by 5 at any time.
- To add to the end of variable tile in your script, click the green right arrow.
- This allows you to do math on your variables, such as "left right"
- Click the plus sign to change the operator from addition to multiplication.
- Multiply "up down" and "left right" by 2 or 3 to make the joystick faster.
Starfish Challenge
Create several fish sketches and have them all move with the joystick
in the exact same manner, like a school of fish that swim together.