def __init__(self, parent): position = list(parent.position()) velocity = list(parent.velocity) position[0] += sin(parent.direction) * parent.radius() * 3 position[1] += cos(parent.direction) * parent.radius() * 3 velocity[0] += sin(parent.direction) * parent.bullet_velocity velocity[1] += cos(parent.direction) * parent.bullet_velocity Mass.__init__(self, tuple(position), parent.bullet_mass, tuple(velocity), MAX_DENSITY, parent.arena) Agent.__init__(self) self.age = 0
def __init__(self, position, mass, steer_power, thrust_power, arena): Mass.__init__(self, position, mass, [0, 0], 1, arena) Agent.__init__(self) self.direction = 0 self.omega = 0 self.decelerating, self.accelerating = False, False self.steer_power = steer_power self.thrust_power = thrust_power self.bullet_velocity = 50 self.bullet_mass = 10 self.health = 1
def __init__(self, position, mass, velocity, density, arena): Mass.__init__(self, position, mass, velocity, density, arena) Agent.__init__(self) self.shape = [random() for i in xrange(24)] self.direction = 0 self.omega = (random() - 0.5) * (pi/50)