def initialize(self): Configurable.initialize(self) if self.dest_y is None: self.dest_y = self.height // 2 self._num_ships = None self.more_ships = self._expand_ships() self.acceleration = min( map(operator.attrgetter('acceleration'), self.more_ships)) self.max_speed = min( map(operator.attrgetter('max_speed'), self.more_ships)) if not hasattr(self, 'blank_move_behavior'): self.blank_move_behavior = self.move_behavior is None if self.blank_move_behavior: # Initialize blank move behavior to get us onscreen self.move_behavior = MoveBehavior.instance( 'move_on_screen', True, initial_dest=(self.center_x, self.dest_y)) self._reached_dest = False self.speedx, self.speedy = 0, 0 if self.center_x is None: self.center_x = 1 / 2 self.to_be_deployed = self.num_ships Movable.initialize(self)
def __init__(self, key): Movable.__init__(self) Configurable.__init__(self, key) self.center = None self._num_ships = None self.more_ships = None
def __init__(self, key): pygame.sprite.Sprite.__init__(self) Movable.__init__(self) Collidable.__init__(self) Configurable.__init__(self, key) self.speedx = self.speedx_prev = 0 self.speedy = self.speedy_prev = 0 self.mask_rect_offsetx = 0 self.mask_rect_offsety = 0 self.x = 0 self.y = 0 self.follow_sprites = set()
def __init__(self, key): Configurable.__init__(self, key) Timekeeper.__init__(self) self.wave_i = 0 self.complete = False
def __init__(self, key): Configurable.__init__(self, key) Timekeeper.__init__(self) self.is_firing = False self.last_fired = 0.0
def __init__(self, key): pygame.sprite.Sprite.__init__(self) Timekeeper.__init__(self) Collidable.__init__(self) Configurable.__init__(self, key)
def __init__(self, key): Configurable.__init__(self, key) self.level_i = 0