Ejemplo n.º 1
0
 def seperation(self):
     steering_force = Vector2D()
     for agent in self.world.agents:
         if(agent is not self and agent.tagged):
             toBot = self.pos - agent.pos
             steering_force += Vector2D.normalise(toBot)/Vector2D.length(toBot)
     return steering_force
Ejemplo n.º 2
0
 def separation(self,group):
     steering_force = Vector2D()
     for agent in group:
         if self != agent and self.tagged:
             toBot =self.pos - agent.pos         
             steering_force += Vector2D.normalise(toBot) / toBot.length()             
     return steering_force
Ejemplo n.º 3
0
 def __init__(self, firing_pos, target_pos):
     self.init_pos = Vector2D.copy(firing_pos)
     self.pos = self.init_pos
     self.direction = Vector2D.normalise(target_pos - self.init_pos)
     self.velocity = 10
     self.radius = 5
     self.collision = None
     self.active = True
Ejemplo n.º 4
0
 def __init__(self, firing_pos, target_pos):
     self.init_pos = Vector2D.copy(firing_pos)
     self.pos = self.init_pos
     self.direction = Vector2D.normalise(target_pos - self.init_pos)
     self.velocity = 10
     self.radius = 5
     self.collision = None
     self.active = True