126 days ago · Tech · hide · Fediverse post

Hello, loves! Looks like there are a couple of methods where our new Cameras object could help out. Here are all the DungeonView users of the Camera object: def on_draw(self): self.clear() self.scroll_dungeon_camera() with self.cameras.dungeon_cam.activate(): self.keyed_floor_sprites.draw() self.draw_contents() self.draw_passages() self.draw_flood() with self.cameras.scroller_cam.activate(): self.cameras.scroller.draw() def scroll_dungeon_camera(self): cx, cy = self.dungeon.player_cell.xy self.cameras.dungeon_cam.position = (cx * cell_size, cy * cell_size) self.cameras.dungeon_cam.view_data.position = ( arcade.camera.grips.constrain_xy( self.cameras.dungeon_cam.view_data, self.cameras.dungeon_camera_bounds )) def on_update(self, delta_time: float): def receive_announcement(msg): self.cameras.scroller.append(msg) self.dungeon.announce_via(receive_announcement) self.cameras.scroller.update() self.pub_sub.publish('on_update', 'view', delta_time=delta_time) Seems to me that the latter two…

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