Home About News Locations Courseware Tidepool Donate Subscribe Contact

Courseware Screencast

back to list next previous
  Lesson 21 - using the joystick  

back to list next previous

Lesson 21 Tasks

  1. Get the joystick from the supply bin by dragging it
  2. When using a new object in Etoys, look for new categories in its viewer.
  3. The are several new variables in the "joystick" category.
  4. A great way to learn in Etoys is to simply experiment.
  5. The left right variable goes from -5 to 5 indicating left & right motion.
  6. The up down variable goes from -5 to to indication up & down motion.
  7. So far, we've used forward-by and turn-by to do motion.
  8. You can change a sketch's x and y variables to move them explicitly.
  9. As you increase y, the sketch goes up.
  10. As you increase x, the sketch goes right.
  11. Read the left-pointing arrow as "becomes", as in "Seymour's X becomes 100".
  12. Click the left-pointing arrow to choose "increase by" instead of "becomes".
  13. We want to increase the x and y by whatever the joystick is currently doing.
  14. To use just variable, drag by its name, not the white arrow.
  15. Drop the joystick's left right variable next to "x increase by".
  16. Drop the joystick's up down variable next to "y increase by".
  17. The joystick is a little sluggish since it only moves by 5 at any time.
  18. To add to the end of variable tile in your script, click the green right arrow.
  19. This allows you to do math on your variables, such as "left right"
  20. Click the plus sign to change the operator from addition to multiplication.
  21. 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.