Refactor key handling and add keybindings configuration for game actions

This commit is contained in:
2025-08-19 18:59:06 +02:00
parent 4099b6f72e
commit 1269913275
6 changed files with 79 additions and 20 deletions
+2 -2
View File
@@ -1,10 +1,10 @@
{
"new_rat": ["Return", 13],
"new_rat": [["keyup", "Return"], ["keydown", "Return"]],
"kill_rat": ["D"],
"toggle_audio": ["M"],
"toggle_full_screen": ["F"],
"scroll_up": ["Up", 8],
"scroll_up": [["keydown", "Up"], ["keydown", "Up"]],
"scroll_down": ["Down", 9],
"scroll_left": ["Left", 10],
"scroll_right": ["Right", 11],
+19
View File
@@ -0,0 +1,19 @@
keybinding_game:
keydown_Return: spawn_rat
keydown_D: kill_rat
keydown_M: toggle_audio
keydown_F: toggle_full_screen
keydown_Up: start_scrolling|Up
keydown_Down: start_scrolling|Down
keydown_Left: start_scrolling|Left
keydown_Right: start_scrolling|Right
keyup_Up: stop_scrolling
keyup_Down: stop_scrolling
keyup_Left: stop_scrolling
keyup_Right: stop_scrolling
keydown_Space: spawn_new_bomb
keydown_N: spawn_nuclear_bomb
keybinding_start_menu:
keydown_Return: reset_game
keydown_Escape: quit_game