def __process__(self, delta_time): if game.is_action_just_pressed(action="confirm"): game.play_sound(sound_id="pacman-chomp") game.change_to_scene(file_path="./scenes/transition.json") if game.is_action_just_pressed(action="exit_game"): game.quit()
def _on_level_reset_timer_timeout(self): if global_obj.player_stats.lives > 0: self.reset_entity_positions() game.start_timer(timer_id=self.show_entities_timer_id, time=0.1) self.level_reset() game.start_timer(timer_id=self.start_timer_id, time=0.5) else: global_obj.game_state = GameState.GAME_OVER game.change_to_scene(file_path="./scenes/transition.json")
def _on_transition_timer_timeout(self): # Temp initialize for now if global_obj.game_state == GameState.INIT or global_obj.game_state == GameState.GAME_OVER: global_obj.game_state = GameState.TITLE_SCREEN game.change_to_scene(file_path="./scenes/title_screen.json") elif global_obj.game_state == GameState.TITLE_SCREEN: global_obj.game_state = GameState.BEGIN_GAME global_obj.player_stats.reset() game.change_to_scene(file_path="./scenes/main.json") elif global_obj.game_state == GameState.LEVEL_COMPLETE: game.change_to_scene(file_path="./scenes/main.json")
def _on_level_cleared_transition_timer_timeout(self): global_obj.player_stats.lives += 1 game.change_to_scene(file_path="./scenes/transition.json")
def _on_init_timer_timeout(self): game.change_to_scene( file_path="./sample_projects/pacman/scenes/transition.json")
def _on_init_timer_timeout(self): game.change_to_scene(file_path="./scenes/transition.json")