def collect_save_data(self, data): level_set_path = self.playing_level_dir if level_set_path == self.get_std_level_dir(): level_set_path = "" data['level_set_path'] = level_set_path data['levels_completed'] = self.levels_completed HGame.collect_save_data(self, data)
def new_game(self): """Prepare for a new game by discarding the current level, clearing the list of completed levels and saved game file name.""" self.stop_level() self.level = None del self.levels_completed[:] HGame.new_game(self)
def restore_save_data(self, data): level_set_path = data.pop('level_set_path') if not level_set_path: level_set_path = self.get_std_level_dir() if not os.path.exists(level_set_path): level_set_path = self.look_for_level_set(level_set_path) if not level_set_path: raise Cancel self.stop_level() self.level = None self.set_playing_level_dir(level_set_path) HGame.restore_save_data(self, data)
def save_game(self, path): """Saves current game progress in the specified file. If a non-standard level set is being played, the pathname of the level set is also recorded in the saved game file.""" HGame.save_game(self, path)
def load_game(self, path): """Restores current level set and saved game progress from the specified file. If the level set can't be found, the user will be asked to look for it.""" HGame.load_game(self, path)