def update(self, speed): Prey.move(self) Prey.wall_bounce(self) if random() <= .3: speed_mult,rad_mult = uniform(-.5,.5),uniform(-.5,.5) while self._speed + speed_mult > 3 and self._speed + speed_mult < 7: self._speed += speed_mult self._angle += rad_mult
def update(self, speed): Prey.move(self) Prey.wall_bounce(self)