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:
+4
-4
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user