Exemple #1
0
 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)
Exemple #2
0
    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)
Exemple #3
0
	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)
Exemple #4
0
	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)
Exemple #5
0
 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)
Exemple #6
0
	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)
Exemple #7
0
    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)
Exemple #8
0
    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)
Exemple #9
0
	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)
Exemple #10
0
	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)