2 hours ago · 9 min read1890 words · Tech · hide · 0 comments

Hello, loves! We’ll remain on the quest to simplify DungeonView a bit longer. I did some things last night, and we’ll do more this morning. As things stood when last we met, the DungeonView maintained more than one SpriteList, one for floor tiles and — I’ve already forgotten — one or more for content items. With a simple change, now all the sprites are in one list. class DungeonView(arcade.View): def __init__(self, dungeon): if arcade.window_commands._window: super().__init__() self.dungeon = dungeon self.pub_sub = dungeon.pub_sub self.subscribe(dungeon, self.pub_sub) self.setup_assets() self.sprite_list = arcade.SpriteList() self.keyed_floor_sprites = KeyedSpriteList(self.sprite_list) self.content_views: dict[Content, ContentView] = dict() self.content_views_by_cell: dict[Cell, list[ContentView]] = defaultdict(list) self.cameras = None self.keys = KeyPress(self, self.dungeon, self.pub_sub) We create just that one SpriteList, and then use it everywhere, in the floor sprites…

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