add pause toggling

This commit is contained in:
2025-07-04 04:53:12 +10:00
parent b7bce71de5
commit 6441ee8a68
2 changed files with 8 additions and 0 deletions

View File

@@ -126,6 +126,11 @@ attack={
, Object(InputEventJoypadButton,"resource_local_to_scene":false,"resource_name":"","device":-1,"button_index":10,"pressure":0.0,"pressed":true,"script":null)
]
}
toggle_pause={
"deadzone": 0.2,
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":4194338,"key_label":0,"unicode":0,"location":0,"echo":false,"script":null)
]
}
[layer_names]

View File

@@ -137,6 +137,9 @@ func _input(event: InputEvent) -> void:
if event.is_action_pressed("toggle_fullscreen"):
fullscreen = not fullscreen
if event.is_action_pressed("toggle_pause"):
get_tree().paused = not get_tree().paused
func set_defaults() -> void:
for property_name: StringName in _default_values.keys():