--- a/src/snake_quest/states/menu.py +++ b/src/snake_quest/states/menu.py @@ -46,7 +46,6 @@ ("CUSTOMIZE", lambda: self.game.change_state(StateID.CUSTOMIZE)), ("SETTINGS", lambda: self.game.change_state(StateID.SETTINGS)), ("CREDITS", lambda: self.game.change_state(StateID.CREDITS)), - ("QUIT", pyxel.quit), ] self.selected = 0 self.height = game.cfg.header.h + game.cfg.area.h + game.cfg.footer.h --- a/src/snake_quest/states/death.py +++ b/src/snake_quest/states/death.py @@ -11,7 +11,7 @@ class DeathStateHandler(GameStateHandler): - """Game over: a box over the last frame with the score's rank, and R restart, M menu, Q quit.""" + """Game over: a box over the last frame with the score's rank, and R restart, M menu.""" TITLE = "GAME OVER" BG = COL_DEATH @@ -19,7 +19,7 @@ def __init__(self, game): super().__init__(game=game) self.rank: int | None = None - self.wdg = self.build_widget([self.TITLE, "(R)ESTART", "(M)ENU", "(Q)UIT"]) + self.wdg = self.build_widget([self.TITLE, "(R)ESTART", "(M)ENU"]) def on_enter(self) -> None: """Record the score in the table of the arc played and show it, with the highscore rank if it made the @@ -31,7 +31,7 @@ lines = [self.TITLE, f"SCORE {self.game.score}"] if self.rank: lines += [f"NEW {played.label} HIGHSCORE #{self.rank}", f"IN {arc.upper()}!"] - self.wdg = self.build_widget([*lines, "", "(R)ESTART", "(M)ENU", "(Q)UIT"]) + self.wdg = self.build_widget([*lines, "", "(R)ESTART", "(M)ENU"]) def build_widget(self, text: list[str]) -> Widget: """The box with `text`, centred in the play area.""" @@ -53,8 +53,6 @@ self.game.restart() if pyxel.btnp(pyxel.KEY_M) or pyxel.btnp(pyxel.GAMEPAD1_BUTTON_B): self.game.change_state(StateID.MENU) - if pyxel.btn(pyxel.KEY_Q): - pyxel.quit() @staticmethod def is_visible() -> bool: --- a/src/snake_quest/states/credits.py +++ b/src/snake_quest/states/credits.py @@ -14,9 +14,6 @@ ("ENGINE", True), ("Pyxel by Takashi Kitao", False), ("(MIT License)", False), - ("", False), - ("CONFIGURATION", True), - ("OmegaConf", False), ("", False), ("THANKS FOR PLAYING!", True), ] --- a/src/snake_quest/game.py +++ b/src/snake_quest/game.py @@ -77,7 +77,11 @@ ) self.initialized = True self.campaign.load_sprites() - self.profile = Profile.load(Path(pyxel.user_data_dir(*USER_DATA)) / "profile.json") + # FredyGames: the browser build keeps the profile in /saves/snake-quest (kept in IndexedDB by the page) + data_dir = Path("/saves/snake-quest") + if not data_dir.is_dir(): + data_dir = Path(pyxel.user_data_dir(*USER_DATA)) + self.profile = Profile.load(data_dir / "profile.json") self.profile.assign_arcs(lambda level: self.campaign.arc_of(level).name) self.backdrop = Backdrop(self) self.stateID = StateID.DEATH