def __init__(self,world):
     dy = 1.0 
     dx = random.uniform(-3.0,3.0)
     self.heading = Vector2D(dx,dy)
     offset = -self.START_Y 
     position = world.bounds.point_at(random.random(), (1.0+offset)/2.0)
     Agent.__init__(self,position,world)
 def __init__(self,world):
     self.in_middle = True
     self.length = self.LENGTH
     self.width  = self.WIDTH
     xoffset = -self.START_X 
     position = world.bounds.point_at((xoffset+1.0)/2.0,self.START_Y)
     Agent.__init__(self,position,world)
 def __init__(self,world, health, START_X, START_Y):
     self.in_middle = True
     self.length = self.LENGTH
     self.width  = self.WIDTH
     xoffset = -START_X 
     position = world.bounds.point_at((xoffset+1.0)/2.0,START_Y)
     self.health = health
     Agent.__init__(self,position,world)
     self.world.brick_list.append(self)
Example #4
0
 def __init__(self, world, yellow_boy=True):
     self.on_left = yellow_boy
     self.length = self.LENGTH
     self.width = self.WIDTH
     self.serving = True
     self.direction = random.randint(1, 4)
     xoffset = -self.START_X
     yoffset = self.START_Y
     position = world.bounds.point_at((xoffset + 1.0) / 2.0,
                                      (yoffset + 1.0) / 2.0)
     Agent.__init__(self, position, world)
 def __init__(self,world, health, START_X, START_Y):
     self.in_middle = True
     self.length = self.LENGTH
     self.width  = self.WIDTH
     xoffset = -START_X 
     if  START_X <= 1.0 and START_X >= -1.0:
         position = world.bounds.point_at(START_X,START_Y)
     else:
         START_X = (-1 + rand())*2
         position = world.bounds.point_at(START_X,START_Y)
     self.health = health
     Agent.__init__(self,position,world)
     self.world.brick_list.append(self)
Example #6
0
 def __init__(self, position, world):
     self.length = self.LENGTH
     self.width = self.WIDTH
     Agent.__init__(self, position, world)
Example #7
0
 def __init__(self, position, world):
     self.length = self.LENGTH
     self.width = self.WIDTH
     self.direction = random.randint(1, 4)
     Agent.__init__(self, position, world)
 def __init__(self, p0, v0, world):
     self.velocity = v0
     self.accel = Vector2D(0.0, 0.0)
     Agent.__init__(self, p0, world)