def __init__(self, localmap, character_name): super().__init__() self.localmap = self.convert_chunks_to_localmap(localmap) self.character_name = character_name self.chunk_size = (13, 13) # the only tuple you'll see I swear. # chunk_size + tilemap size self.map_grid = glooey.Grid(self.chunk_size[0], self.chunk_size[1], 32, 32) self.map_grid.set_left_padding(16) # for the border. self.map_grid.set_top_padding(16) self.TileManager = TileManager() self.ItemManager = ItemManager() self.RecipeManager = RecipeManager() # glooey uses x,y for grids from the top left. for i in range(self.chunk_size[0]): for j in range(self.chunk_size[1]): # init the MapTile(s) self.map_grid.add(i, j, MapTile(None)) # insert the background into our ordered groups. self.insert(CustomBackground(), 0) # insert the map_grid into our ordered group. self.insert(self.map_grid, 1) # self.insert(self.weather_board, 2) self.update_map_for_position( self.find_character_in_localmap().position)
def __init__(self, first_name, last_name): MastermindClientTCP.__init__(self) pygame.init() pygame.display.set_caption('Cataclysm: Looming Darkness') self.screen = pygame.display.set_mode((854, 480), pygame.ANYFORMAT) self.TileManager = TileManager() self.ItemManager = ItemManager() self.RecipeManager = RecipeManager( ) # contains all the known recipes in the game. for reference. self.FontManager = FontManager() self.player = Player( str(first_name) + str(last_name) ) # recieves updates from server. the player and all it's stats. #TODO: name and password. self.localmap = None self.hotbars = [] self.hotbars.insert(0, Hotbar(self.screen, 10, 10)) # insert buttons when we open a screen and destroy them when we leave it. self.buttons = [] #self.buttons.insert(0, Button(self.screen, 'BUTTON!', (120,120,120), (50,50,50,50))) #self.buttons.insert(0, Button(self.screen, 'BUTTON!', (120,120,120), (150,50,50,50))) #self.buttons.insert(0, Button(self.screen, 'BUTTON!', (120,120,120), (150,150,50,50))) #self.buttons.insert(0, Button(self.screen, 'BUTTON!', (120,120,120), (50,150,50,50))) self.textboxes = [] self.listboxes = []
def __init__(self): MastermindServerTCP.__init__(self, 0.5, 0.5, 300.0) self.players = {} # all the Players() that exist in the world whether connected or not. self.localmaps = {} # the localmaps for each player. self.overmaps = {} # the dict of all overmaps by player.name #self.options = Options() self.calendar = Calendar(0, 0, 0, 0, 0, 0) # all zeros is the epoch # self.options.save() self.worldmap = Worldmap(26) # create this many chunks in x and y (z is always 1 (level 0) for genning the world. we will build off that for caverns and ant stuff and z level buildings. self.starting_locations = [Position(23, 23, 0)] #TODO: starting locations should be loaded dynamically from secenarios self.RecipeManager = RecipeManager() self.ProfessionManager = ProfessionManager() self.MonsterManager = MonsterManager() self.ItemManager = self.worldmap.ItemManager self.FurnitureManager = self.worldmap.FurnitureManager
def __init__(self): MastermindServerTCP.__init__(self, 0.5, 0.5, 300.0) self.players = { } # all the Players() that exist in the world whether connected or not. self.localmaps = {} # the localmaps for each player. self.overmaps = {} # the dict of all overmaps by player.name self.options = Options() self.calendar = Calendar(0, 0, 0, 0, 0, 0) # all zeros is the epoch self.options.save() self.worldmap = Worldmap( 13 ) # create this many chunks in x and y (z is always 1 (level 0) for genning the world. we will build off that for caverns and ant stuff and z level buildings. self.starting_locations = [ Position(24, 24, 0) ] #TODO: starting locations should be loaded dynamically from secenarios for i in range(1, 13): self.starting_locations.append(Position(24 + i, 24, 0)) self.RecipeManager = RecipeManager()