Inventory Improvement 0 ▲ ronjeffries.com 1 hour ago · Tech · hide · 0 comments Hello, loves! Made it work. Now let’s make it right. Yummy! Tout le monde déteste l’IA. The problem we’ve solved, whose solution we’ll be improving, is the creation of sprites for Content instances that are not in the dungeon when it’s created but that will turn up later. Our sole example is the honeycomb that Buzz Bee gives to Dot when Dot shows up with the right flower. The general idea behind the solution is that when the KeyedSpriteListMaker is processing dungeon contents (Buzz is a kind of Content), the KSLM asks the Content instance for contained_items, expecting a list of other Content instances, and it makes sprites for those and indexes them into the KeyedSpriteList. The solution in place is clean on the outside, and dirty on the inside. Outside the code is pretty reasonable: class KeyedSpriteListMaker: def create_content_lists(self, dungeon, keyed_sprites): for cell, content in dungeon.layout.contents.items(): for item in content:… No comments yet. Log in to reply on the Fediverse. Comments will appear here.