193 days ago · 7 min read1375 words · Tech · hide · Fediverse post

We’ll glance at the scrolling code, see what we can improve, and use it on our existing treasures. Hm, there’s an issue already. The Scroller is rather obviously a view thing, but the Dungeon takes care of the handing out contents. We’ll look at that but let’s first review the Scroller situation as it stands: class DungeonView(arcade.View): def __init__(self, dungeon, testing=False): if not testing: super().__init__() self.dungeon = dungeon self.key_lock = None self.shape_list = None self.camera = None self.camera_bounds = None self.scroller = None self.text_camera = None if testing: return def setup(self): self.setup_scroller() self.setup_camera() self.shape_list = arcade.shape_list.ShapeElementList() self.create_rooms(self.shape_list) def setup_camera(self): self.camera = arcade.Camera2D() zoom = 4 self.camera.zoom = zoom w = 64 h = 56 width = w * cell_size height = h * cell_size width_in_cells = w // zoom height_in_cells = h // zoom width_margin = width_in_cells // 2 * cell_size…

Commenting on Bubbles has been removed. Why? If you want to talk about this post, write to the author, use the comments on their blog if it has them, or reply with a "RE:" post on your own blog. Suggestions? feedback@bubbles.town