STEP 10: Let's get these cars moving! If the cars are on the first or third road, they will drive to the right.

  • Edit the car's arguments so that they look like this: ("car1", -400, my_var)
  • From , drag out Turn Right onto the next line. Make sure it's indented twice!
  • Drag out Set Size onto the next line, also indented twice.
  • From , drag out Set x Speed. Change the speed from 5 to 2. This will send cars to the right!

# sprite = codesters.Rectangle(x, y, width, height, "color") start = codesters.Rectangle(0, -250, 500, 50, "red") # sprite = codesters.Rectangle(x, y, width, height, "color") finish = codesters.Rectangle(0, 250, 500, 50, "green") my_list = [-150, -50, 50, 150] for value in my_list: pass # delete after adding indented code # add code here # sprite = codesters.Rectangle(x, y, width, height, "color") sprite = codesters.Rectangle(0, value, 500, 50, "gray") # sprite = codesters.Sprite("image", x, y) sprite = codesters.Sprite("turtle1", 0, -240) sprite.set_size(.2) sprite.turn_left(90) def interval(): my_var = random.choice(my_list) if my_var == -150 or my_var == 50: pass # delete after adding indented code # add your code here sprite = codesters.Sprite("car1") stage.event_interval(interval, 0.5)