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:
+1
-1
@@ -49,7 +49,7 @@ class Prop
|
||||
end
|
||||
|
||||
def update(dt)
|
||||
return unless Gosu.button_down?(Gosu::MS_LEFT) || Gosu.button_down?(Gosu::KB_X)
|
||||
return unless Gosu.button_down?(Gosu::MS_LEFT) || Gosu.button_down?($bus.get(:settings, :break))
|
||||
|
||||
player_x, player_y = $bus.get(:player_position) || [0, 0]
|
||||
|
||||
|
||||
@@ -122,7 +122,7 @@ class PropsHandler
|
||||
@grid.delete([prop.x, prop.y])
|
||||
end
|
||||
end
|
||||
if Gosu.button_down?(Gosu::KB_P) # place selected if it is a placeable item
|
||||
if Gosu.button_down?($bus.get(:settings, :place))
|
||||
selected_item = $bus.get(:selected_item)
|
||||
if selected_item == :torch
|
||||
player_x, player_y = $bus.get(:player_position) || [0, 0]
|
||||
|
||||
Reference in New Issue
Block a user