Mar 092017
 
  1. Log into scratch and start a new program
  2. Create a new sprite and draw a simple traffic light
  3. traffic light
  4. Duplicate the costume and fill in the lights in the correct sequence (as discussed in class)
  5. Program your traffic lights
  6. Get a car sprite and get it move left and right on your screen (you will need the if on edgebounce block)
  7. car move
  8. Click the left-right arrow in the sprite settings (so it doesn’t go upside down when going left)
  9. Can you change the car script so that it only moves when the traffic lights are green?
    1. Make a new variable (in data blocks) called “lights”
    2. In the traffic light code, make it change “lights” to “green”, “green+amber”, “red”, “amber”
    3. Make the car move only when lights are green (forever, if, lights = green, move)
  10. Get the Scratch cat to walk across the road, when the lights are on red.
  11. Use this crash code to stop the game if there is a crash:
  12. crash
  13. Can you add a pedestrian crossing button (a new sprite) so that when you press it, it turns the lights red?

 Leave a Reply

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

This site uses Akismet to reduce spam. Learn how your comment data is processed.