fuzzyworld

godot-shooter / commit

"Escape" in web games will just restart the game.

59b480f0b7600d04a2b49da99f2ac9ff6f5defd3 · Pavel Safronov · 2023-10-31 16:46:27 -0700 · parents f1a0def4ab99

"Escape" in web games will just restart the game.
 Player.gd | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/Player.gd b/Player.gd
index 3f2bcec..bc42077 100644
--- a/Player.gd
+++ b/Player.gd
@@ -16,11 +16,10 @@ var can_fire = true
 
 func _process(delta: float) -> void:
 	if Input.is_action_just_pressed("exit"):
-		var p = PopupControl.instance()
-		p.message = OS.get_name()
-		add_child(p)
 		if OS.get_name() == "OSX":
 			get_tree().quit()
+		else:
+			restart()
 	if Input.is_action_just_pressed("restart"):
 		restart()
 	if dead: