Aggiungi supporto per la pausa tramite un nuovo tasto nella classe KeyBindings

This commit is contained in:
2024-12-23 17:03:23 +01:00
parent 3eecc98304
commit 3ee958b235
2 changed files with 3 additions and 3 deletions
+1 -1
View File
@@ -30,7 +30,7 @@ class KeyBindings:
elif key == "Space" or key == 1: elif key == "Space" or key == 1:
self.play_sound("PUTDOWN.WAV") self.play_sound("PUTDOWN.WAV")
self.spawn_bomb(self.pointer) self.spawn_bomb(self.pointer)
elif key == "P": elif key == "P" or key == 16:
self.pause = not self.pause self.pause = not self.pause
# elif key == "mouse": # elif key == "mouse":
# adjusted_coords = (coords[0]//self.cell_size*2, coords[1]//self.cell_size*2) # adjusted_coords = (coords[0]//self.cell_size*2, coords[1]//self.cell_size*2)
+2 -2
View File
@@ -155,8 +155,8 @@ class GameWindow:
elif event.type == sdl2.SDL_JOYBUTTONUP: elif event.type == sdl2.SDL_JOYBUTTONUP:
key = event.jbutton.button key = event.jbutton.button
self.key_up(key) self.key_up(key)
elif event.type == sdl2.SDL_JOYAXISMOTION: # elif event.type == sdl2.SDL_JOYAXISMOTION:
self.axis_scroll(event.jaxis.axis, event.jaxis.value) # self.axis_scroll(event.jaxis.axis, event.jaxis.value)
# Disegna qui gli sprite # Disegna qui gli sprite