Aggiungi supporto per input da tastiera con codici ASCII nel gioco
This commit is contained in:
@@ -78,9 +78,9 @@ class MiceMaze:
|
||||
|
||||
def key_pressed(self, key):
|
||||
print(key)
|
||||
if key == "Q":
|
||||
if key == "Q" or key == 12:
|
||||
self.engine.close()
|
||||
elif key == "Return":
|
||||
elif key == "Return" or key == 13:
|
||||
self.new_rat()
|
||||
elif key == "D":
|
||||
if self.units:
|
||||
@@ -90,15 +90,15 @@ class MiceMaze:
|
||||
elif key == "F":
|
||||
self.full_screen = not self.full_screen
|
||||
self.engine.full_screen(self.full_screen)
|
||||
elif key == "Up":
|
||||
elif key == "Up" or key == 8:
|
||||
self.scroll_cursor(y=-1)
|
||||
elif key == "Down":
|
||||
elif key == "Down" or key == 9:
|
||||
self.scroll_cursor(y=1)
|
||||
elif key == "Left":
|
||||
elif key == "Left" or key == 10:
|
||||
self.scroll_cursor(x=-1)
|
||||
elif key == "Right":
|
||||
elif key == "Right" or key == 11:
|
||||
self.scroll_cursor(x=1)
|
||||
elif key == "Space":
|
||||
elif key == "Space" or key == 1:
|
||||
self.play_sound("PUTDOWN.WAV")
|
||||
self.spawn_bomb(self.pointer)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user