godot-shooter / commit
Pause game on death.
Player.gd | 2 ++ Player.tscn | 1 + 2 files changed, 3 insertions(+) diff --git a/Player.gd b/Player.gd index 4c3e7ed..2806aaa 100644 --- a/Player.gd +++ b/Player.gd @@ -42,6 +42,7 @@ func kill(): $CanvasLayer/CenterContainer/DeathScreen.show() Input.mouse_mode = Input.MOUSE_MODE_VISIBLE z_index = -1 + get_tree().paused = true func heal(amount: int = 1): if dead: @@ -94,4 +95,5 @@ func allow_fire(): can_fire = true func _on_Button_pressed() -> void: + get_tree().paused = false restart() diff --git a/Player.tscn b/Player.tscn index 883bf7a..c06924c 100644 --- a/Player.tscn +++ b/Player.tscn @@ -48,6 +48,7 @@ margin_bottom = 84.0 mouse_filter = 2 [node name="DeathScreen" type="Control" parent="CanvasLayer/CenterContainer"] +pause_mode = 2 visible = false mouse_filter = 2 size_flags_horizontal = 5