def __init__(self, random=random, granularity=1, platformClock=None): SimulationTime.__init__(self, granularity, platformClock) self.random = random #the plant self.plant = Plant() #array for the players self.players = []
def __init__(self, random=random, playerCreationRectangle=None, granularity=1, platformClock=None): SimulationTime.__init__(self, granularity, platformClock) if playerCreationRectangle is None: playerCreationRectangle = point(1, 1), point(5, 5) self.random = random self.playerCreationRectangle = playerCreationRectangle self.observers = [] self.players = [] self.terrain = Terrain()
def start(self): SimulationTime.start(self) # add plant update as an observer to the sim time tick self.addObserver(self.plant.update)