--- a/game/main.py +++ b/game/main.py @@ -101,9 +101,16 @@ class App: def __init__(self): # Init screen - pyxel.init(SCREEN_WIDTH, SCREEN_HEIGHT, title="Fagos Across Your System", fps=60) + pyxel.init(SCREEN_WIDTH, SCREEN_HEIGHT, title="Fagos Across Your System", fps=60, + quit_key=pyxel.KEY_NONE) # File where the resources are loaded pyxel.load("../assets/pyxres.resources.pyxres") + # FredyGames: the game over and game complete screens say "PRESS Q TO QUIT", which does nothing on the + # web (quitting only freezes the page): blank those tiles + for x in range(9, 16): + pyxel.tilemaps[6].pset(x, 14, (0, 0)) + pyxel.tilemaps[7].pset(x, 14, (17, 30)) + pyxel.tilemaps[7].pset(x, 15, (17, 31)) # Initialize variables self.level = Level(SCREEN_WIDTH, SCREEN_HEIGHT, LEVEL_SPEED) self.hud = Hud(SCREEN_HEIGHT, SCREEN_WIDTH) @@ -379,9 +386,6 @@ if pyxel.btnp(pyxel.KEY_RETURN): pyxel.play(3, 9) self.game_state = self.previous_game_state - if pyxel.btnp(pyxel.KEY_Q): - pyxel.play(3, 9) - pyxel.quit() def update_tittle_scene(self): if pyxel.btnp(pyxel.KEY_RETURN): @@ -404,8 +408,6 @@ else: self.start_new_game() pyxel.playm(2, loop=True) - if pyxel.btnp(pyxel.KEY_Q): - pyxel.quit() def update_level_completed_scene(self): boss_bullet_list.clear() @@ -426,9 +428,6 @@ self.bosses.clear() self.bacterias.clear() - if pyxel.btnp(pyxel.KEY_Q): - pyxel.play(3, 9) - pyxel.quit() if pyxel.btnp(pyxel.KEY_RETURN): pyxel.play(3, 9) self.start_new_game() @@ -441,9 +440,10 @@ self.fago = Fago(32, 32, FAGO_SPEED) self.fago_direction = Directions.DOWN self.bosses = [] - self.bosses.append(Boss(SCREEN_WIDTH - 24, SCREEN_HEIGHT / 2 - 16)) - self.bosses.append(Boss(SCREEN_WIDTH - 24, SCREEN_HEIGHT / 2 - 16)) - self.bosses.append(Boss(SCREEN_WIDTH - 24, SCREEN_HEIGHT / 2 - 16)) + # FredyGames: the speed argument was missing, so trying again after a game over crashed + self.bosses.append(Boss(SCREEN_WIDTH - 24, SCREEN_HEIGHT / 2 - 16, BOSS_SPEED)) + self.bosses.append(Boss(SCREEN_WIDTH - 24, SCREEN_HEIGHT / 2 - 16, BOSS_SPEED)) + self.bosses.append(Boss(SCREEN_WIDTH - 24, SCREEN_HEIGHT / 2 - 16, BOSS_SPEED)) self.bacterias = [] self.bacterias.append(Bacteria((SCREEN_WIDTH / 2) + 24, 8.0)) self.bacterias.append(Bacteria((SCREEN_WIDTH / 2) + 24, 104, Directions.DOWN)) --- a/view/hud.py +++ b/view/hud.py @@ -66,4 +66,3 @@ pyxel.rect(self.paused_x - 1, 0, len(self.paused) * pyxel.FONT_WIDTH + 1, pyxel.FONT_HEIGHT + 1, 1) pyxel.text(self.paused_x, 1, self.paused, 3) pyxel.text(self.enter_x, self.enter_y, self.enter, pyxel.frame_count % 16) - pyxel.text(self.enter_x + 15, self.enter_y + 20, "PRESS Q TO QUIT", pyxel.frame_count % 16)