Пример #1
0
 def __init__(self, x, y, target_x, target_y, group, listed, speed=13, shooting_range=300):
     Unit.__init__(self, x, y, r=7, colour='red')
     self.speed = speed
     self.shooting_range = shooting_range
     self.target_x = target_x
     self.target_y = target_y
     self.step = self.shooting_range/self.speed
     self.proj_calc(target_x, target_y)
     self.group = group
     self.listed = listed
Пример #2
0
 def __init__(self, camera):
     Unit.__init__(self, x=start['x'], y=start['y'], r=start['hero_r'], colour='#23409E')
     self.counter = 0
     self.max_speed = HERO_MAX_SPEED
     self.moving = {'up': False,
                    'down': False,
                    'right': False,
                    'left': False}
     self.speed = {'y_up': 0,
                   'y_down': 0,
                   'x_right': 0,
                   'x_left': 0}
     self.camera = camera
Пример #3
0
 def __init__(self, x, y, listed, food=(), level=0, group='Enemy'):
     Unit.__init__(self, x, y, colour='#6d2f84')
     self.logic = {
         1: {
             'r': 14,
             'max_speed': 4,
             'vision_range': 0,
             'health': 1,
             'value': 0,
             'colour': '#6d2f84',
             'limit_counter': 0
         },
         2: {
             'r': 32,
             'max_speed': 5,
             'vision_range': 60,
             'health': 1,
             'value': 2,
             'colour': '#1B702F',
             'limit_counter': 1
         },
         3: {
             'r': 47,
             'max_speed': 3,
             'vision_range': 47,
             'health': 2,
             'value': 3,
             'colour': '#a39b49',
             'limit_counter': 1
         }
     }
     self.group = group
     self.level = level
     self.food = food
     self.r = self.logic[self.level]['r']
     self.max_speed = self.logic[self.level]['max_speed']
     self.vision_range = self.logic[self.level]['vision_range']
     self.health = self.logic[self.level]['health']
     self.colour = self.logic[self.level]['colour']
     self.value = self.logic[self.level]['value']
     self.exp = 0
     self.alive = True
     self.move_counter = 0
     self.hit_counter = 0
     self.spawn_counter = 0
     self.fertility = 3
     self.listed = listed
     self.move_y = choice([self.move_down, self.move_up])
     self.move_x = choice([self.move_left, self.move_right])
     self.speed = {'y': 0, 'x': 0}
     Enemy.limit_counter += self.logic[self.level]['limit_counter']
Пример #4
0
 def __init__(self):
     Unit.__init__(self, x=spawn['x'], y=spawn['y'], r=40, speed=hero_speed, colour='blue')
     self.counter = 0
Пример #5
0
 def __init__(self, x, y):
     Unit.__init__(self, x, y, colour='darkred')
Пример #6
0
 def __init__(self):
     Unit.__init__(self, x, y, r=10, shooting_range=150, speed=10, visual=None, colour='red')