I'm attempting to write a code in which the user can add as many of a certain object as needed, and blit it on to a pygame window. Essentially a game engine of sorts. I need to make it so that they can add as many of these objects as they need, so that they can create a game world. The only problem I'm encountering is that I cannot create enough names for all of this by hard-coding it, and even then it would not be enough. So is there a way for me to make it so that they can name each class, or so that it would be procedurally generated names for each class? Here is my class:
##My Class
class objectMesh():
def __init__(self, objectType, color, width, dimensions): ##Send dimensions depending on what is required for each pygame.draw command. Polygons are
self.objectType, self.color, self.width, self.dimensions = objectType, color, width, dimensions ##list of vertices, circles are center + radius, etc.
def drawObject(self):
if self.objectType == 0:
drawRect(self.dimensions, self.color, self.width)