17 hours ago · Tech · 0 comments

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…

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