Refactor input handling: replace hardcoded key inputs with configurable key bindings for character movement, inventory navigation, and actions; enhance settings scene with key rebind functionality and add credits scene.

This commit is contained in:
2026-04-03 14:46:35 +01:00
parent 5814a1fdee
commit bf1171a775
13 changed files with 175 additions and 41 deletions
+4 -4
View File
@@ -76,10 +76,10 @@ class Character
dx = 0.0
dy = 0.0
dx -= 1 if Gosu.button_down?(Gosu::KB_A)
dx += 1 if Gosu.button_down?(Gosu::KB_D)
dy -= 1 if Gosu.button_down?(Gosu::KB_W)
dy += 1 if Gosu.button_down?(Gosu::KB_S)
dx -= 1 if Gosu.button_down?($bus.get(:settings, :leftward))
dx += 1 if Gosu.button_down?($bus.get(:settings, :rightward))
dy -= 1 if Gosu.button_down?($bus.get(:settings, :forward))
dy += 1 if Gosu.button_down?($bus.get(:settings, :backward))
moving = dx != 0 || dy != 0