def __init__(self, event_controller, env): # Save event_controller to use later self.event_controller = event_controller self.env = env #set some value for head self.number_of_enemy = NUM_SPRITES.NUMBER_OF_ENEMY self.time_to_create_new = DURATION.TIME_CREATE_NEW self.max_of_current_enemy = NUM_SPRITES.MAX_OF_CURRENT_ENEMY self.totalCreatedEnemy = 0 # Constructor of base class Observer.__init__(self) # Register to receive some special events self.register(event_controller, 'special') Waiter.__init__(self) # Attribute declare self.quit_game = False self.player = None #self.drawable_components = [] self.heads = [] self.head_timer = None # Init pygame pygame.init() pygame.mixer.init() self.screen = pygame.display.set_mode(self.env.screen_size) pygame.mouse.set_visible(False) # Hide default mouse cursor
def __init__(self, event_controller, env): # Init pygame pygame.init() pygame.mixer.init() # Save event_controller to use later self.event_controller = event_controller self.env = env # Set some value for head self.number_of_enemy = NUM_SPRITES.NUMBER_OF_ENEMY self.time_to_create_new = DURATION.TIME_CREATE_NEW self.max_of_current_enemy = NUM_SPRITES.MAX_OF_CURRENT_ENEMY self.totalCreatedEnemy = 0 # Constructor of base class Observer.__init__(self) # Register to receive some special events self.register(event_controller, 'special') Waiter.__init__(self) # Attribute declare self.quit_game = False self.player = None self.heads = [] self.head_timer = None self.interval_section = 3 self.appear_delay = 3 self.stick_time = 0.12 self.is_first_blood = True self.sound_prepare4battle = Factory.get_sound('prepare4battle') if self.sound_prepare4battle is None: raise NotImplementedError self.sound_prepare4battle_playing = False self.sound_first_blood = Factory.get_sound('first_blood') if self.sound_first_blood is None: raise NotImplementedError self.sound_double_kill = Factory.get_sound('double_kill') if self.sound_double_kill is None: raise NotImplementedError self.sound_triple_kill = Factory.get_sound('triple_kill') if self.sound_triple_kill is None: raise NotImplementedError self.sound_ultra_kill = Factory.get_sound('ultra_kill') if self.sound_ultra_kill is None: raise NotImplementedError self.sound_rampage_kill = Factory.get_sound('rampage') if self.sound_rampage_kill is None: raise NotImplementedError self.screen = pygame.display.set_mode(self.env.screen_size) pygame.mouse.set_visible(False) # Hide default mouse cursor self.timer_counter = None self.stage = None self.id = 0 self.finish = False self.num_head_kill_in_section = 0