class WorldManager(): #the aray of variables for worlds def __init__(self): self.worlds = [] self.current_world = 0 self.total_worlds = 0 #adding world files to the aray def AddWorld(self, world): self.worlds.append(world) self.total_worlds += 1 #get world from the aray def GetWorld(self, index): return self.worlds[index] #setting world value manuly def SetWorld(self, index): self.current_world = index return self.worlds[self.current_world] #if you want the go to next world def NextWorld(self): self.current_world += 1 if(self.current_world == self.worlds.__len__()): return None return self.worlds[self.current_world] # the world before the current one def PreviousWorld(self): if(self.current_world > 0): self.current_world -= 1 return self.worlds[self.current_world] #getting the current world number def GetWorldNumber(self): return self.current_world #when you reach the end def ReachedEnd(self): if self.current_world == self.worlds.__len__(): return True return False