def __change_scenes(self): self.__current_scene.player.set_location( self.__end_location.x, self.__end_location.y) self.__current_scene = self.__next_scene if self.__current_scene.song != "": play_song(self.__current_scene.song) self.__current_scene.update_ui()
def __restart_level(self): self.entities = [ self.actor ] self.__load_level(self.previous_level) self.first_pass = True play_song(self.song)
def __set_starting_scene(self, starting_scene_type): assert (len(self.__all_scenes) > 0), \ "It looks like you never initialized all the scenes! Make sure to setup and call __initialize_scenes()" self.__current_scene = self.__all_scenes[int(starting_scene_type)] play_song(self.__current_scene.song) self.__current_scene.relay_player( Player( 16 * 7, 16 * 5 ) )
def __restart_level(self): self.boss = BossCrab() self.left_claw = Claw(self.boss, True) self.right_claw = Claw(self.boss, False) self.entities = [ self.boss, self.left_claw, self.right_claw ] self.actor.pause = True self.actor.set_location(self.scene_bounds.width / 2 - self.actor.width / 2, -64) self.entities.append(self.actor) self.__load_level(0) self.first_pass = True self.queue_song = True self.delay = Timer(1500, True) play_song("snore.wav", 0.5)
def __change_scenes(self): if self.__current_scene == self.__next_scene: return self.__current_scene = self.__next_scene play_song(self.__current_scene.song)
def update(self, delta_time): super(Boss, self).update(delta_time) if self.actor.transitioning == True: self.actor.transitioning = False if self.boss.injured: if not self.glory_delay.started: self.glory_delay.start() self.glory_delay.update(delta_time) if self.glory_delay.done: self.closing_transition.update(delta_time) #self.manager.get_scene(SceneType.TITLE).relay_actor(self.actor) #self.manager.queue_next_scene(SceneType.TITLE) #self.glory_delay.reset() if self.closing_transition.done: self.manager.I_GIVE_UP() if self.actor.transitioning == True: self.actor.transitioning = False self.delay.update(delta_time) if not self.delay.done: self.actor.pause = True self.actor.velocity = Vector2(0, 0) self.actor.set_location(self.scene_bounds.width / 2 - self.actor.width / 2, -64) if self.boss.hurt: if self.queue_song: self.queue_song = False play_song("liocarcinus.wav") if self.boss.special_attack: self.boss.special_attack = False self.boss.crab_smash = False self.boss.sync_smash = 0 self.__create_boulders() if self.actor.grounded and self.actor.pause: self.actor.pause = False if isinstance(self.actor, Player) and self.actor.restart: self.start_transition = True if self.transition.first_half_complete: self.actor.revive() self.__restart_level() if self.start_transition: self.transition.update(delta_time) if self.transition.done: self.transition.reset() self.start_transition = False if self.actor.x + self.actor.width + 4 > self.scene_bounds.width: self.actor.set_location(self.scene_bounds.width - self.actor.width - 4, self.actor.y)
def update(self, delta_time): super(Title, self).update(delta_time) play_song(self.song)
def __play_mocking_music(self): if not self.queue_restart: play_song("fin.wav") self.queue_restart = True self.restart_delay.reset() self.restart_delay.start()