14 hours ago · Tech · 0 comments

I’m not sure what I’ll do this morning. Look for something that interests me, I guess. We follow our nose. Refactoring for fun and profit. Ah, here’s something that needs doing. We have no clear scheme for determining the dimensions of the window the game runs in. Let’s see what all we do. We start with a DungeonLayout, which has a specified number of cells in x and y directions. Our main uses 64x56 because anything larger than 56 is too tall for my screen. That information is not saved in DungeonLayout and probably should be: class DungeonLayout: def __init__(self, max_x=10, max_y=10): self.border_map = None self.cells = dict() for x in range(max_x): for y in range(max_y): self.cells[(x,y)] = Cell(x, y) self.rooms = [] We’ll save those values as members. class DungeonLayout: def __init__(self, max_x=10, max_y=10): self.max_x = max_x self.max_y = max_y self.border_map = None self.cells = dict() for x in range(max_x): for y in range(max_y): self.cells[(x,y)] = Cell(x, y) self.rooms =…

No comments yet. Log in to reply on the Fediverse. Comments will appear here.