def _set_CSV_symbol(self): """Set the csv symbol of the element""" if self.name == "MacGyver": self._csvSymbol = "M" else: #We set the path to the json file that contains the correspondence table between name of an element and its symbol symbolDictPath = path.setPath("resources", "element.json") try: jsonDict = open(symbolDictPath) except: print( "Couldn't open the element.json file in Element._set_CSV_symbol()" ) json_str = jsonDict.read() symbolDict = json.loads( json_str) #Convert the string json into a dict self._csvSymbol = symbolDict[self.name]["Symbol"]
def _set_skin(self): """Set the path for the skin to be displayed for this element""" fileName = self.name.lower() + "-40x40.png" self._skin = path.setPath("resources/img", fileName)
def _set_tiles_path(self): """Set the tiles""" #Loading the image for the tiles self._tilesPath = path.setPath("resources/img","floor-tiles-20x20.png")
def _set_CSV_Path(self): """Set the csv path depending on the number of the level""" fileName = "level"+str(self.numLevel)+".csv" self._csvPath = path.setPath("resources/levels",fileName)
def setConfiguration(config_dict): """Set all the configuration of the game """ config_dict["title_screen_path"] = path.setPath("resources/img","title_screen.png") return config_dict