self.preyLOS = False for prey in self.world.agents: if not prey.hunter and self.loscheck(prey.pos): self.preyLOS = True self.acceleration = self.pursuit(prey) #hackish, should pursue nearest prey, but works for now if not self.preyLOS: self.acceleration = self.wander(delta)