125 days ago · Tech · hide · Fediverse post

Hello, loves! Let’s move on_key_press out of DungeonView. Down to 146 lines, from 226 just a few commits ago. I think I’ll just do it unless something interesting comes up. Here it is going in: def on_key_press(self, symbol: int, modifiers: int) -> bool | None: if self.key_lock is not None: return self.key_lock = symbol if symbol == arcade.key.RIGHT: self.move_player(Direction.EAST) elif symbol == arcade.key.LEFT: self.move_player(Direction.WEST) elif symbol == arcade.key.UP: self.move_player(Direction.NORTH) elif symbol == arcade.key.DOWN: self.move_player(Direction.SOUTH) elif symbol == arcade.key.F: self.dungeon.maker_flood() elif symbol == arcade.key.B and (modifiers & arcade.key.MOD_CTRL): message = 'You have been eaten by a breakpoint!' self.pub_sub.publish('announce', 'view', message=message) pass elif symbol == arcade.key.H: self.dungeon.make_initial_announcement() elif symbol == arcade.key.K: self.dungeon.show_path_to('a red key', self) else: self.key_lock = None def…

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