Ejemplo n.º 1
0
    def __init__(self, x, y, road, length_along_road, master, car_images,
                       car_size, spawn_delay=2.0, cars=[], generative=False):
        Intersection.__init__(self, x, y, incoming_roads=[])
        self.road = road
        self.length_along_road = length_along_road
        self.cars = set(cars)
        self.generative = generative

        # set up the car spawning thread
        source_thread = threading.Thread(target=self.spawn_loop,
                        args=[master, car_images, car_size, spawn_delay])
        source_thread.daemon = True
        source_thread.start()
Ejemplo n.º 2
0
    def __init__(self,
                 x,
                 y,
                 road,
                 length_along_road,
                 master,
                 car_images,
                 car_size,
                 spawn_delay=2.0,
                 cars=[],
                 generative=False):
        Intersection.__init__(self, x, y, incoming_roads=[])
        self.road = road
        self.length_along_road = length_along_road
        self.cars = set(cars)
        self.generative = generative

        # set up the car spawning thread
        source_thread = threading.Thread(
            target=self.spawn_loop,
            args=[master, car_images, car_size, spawn_delay])
        source_thread.daemon = True
        source_thread.start()
Ejemplo n.º 3
0
 def __init__(self, x, y, destructive=False):
     Intersection.__init__(self, x, y, outgoing_roads=[], incoming_roads=[])
     self.destructive = destructive
     self.cars = set()
Ejemplo n.º 4
0
 def __init__(self, x, y, destructive=False):
     Intersection.__init__(self, x, y, outgoing_roads=[], incoming_roads=[])
     self.destructive = destructive
     self.cars = set()