aboutsummaryrefslogtreecommitdiffstats
path: root/godot/scenes/Game.gd
diff options
context:
space:
mode:
authorLibravatar cel <cel@blos.sm>2022-07-16 22:42:19 +0100
committerLibravatar cel <cel@blos.sm>2022-07-16 22:42:19 +0100
commitfdbba87b346c6020d7349d0c2cb3793fcdab25f3 (patch)
tree7c5f3481dc1bd77d332a318d687eb714fea3ef68 /godot/scenes/Game.gd
parent717a665a84dd9ca1b545d57976b87ba77bf11d80 (diff)
download2022-fdbba87b346c6020d7349d0c2cb3793fcdab25f3.tar.gz
2022-fdbba87b346c6020d7349d0c2cb3793fcdab25f3.tar.bz2
2022-fdbba87b346c6020d7349d0c2cb3793fcdab25f3.zip
add menu and switch die code from rust to gdscript
Diffstat (limited to '')
-rw-r--r--godot/scenes/Game.gd31
1 files changed, 31 insertions, 0 deletions
diff --git a/godot/scenes/Game.gd b/godot/scenes/Game.gd
new file mode 100644
index 0000000..31e543d
--- /dev/null
+++ b/godot/scenes/Game.gd
@@ -0,0 +1,31 @@
+extends Spatial
+
+
+# Declare member variables here. Examples:
+# var a = 2
+# var b = "text"
+
+
+# Called when the node enters the scene tree for the first time.
+func _ready():
+ pass # Replace with function body.
+
+
+# Called every frame. 'delta' is the elapsed time since the previous frame.
+func _process(delta):
+ if Input.is_action_just_pressed("ui_cancel"):
+ get_tree().paused = true
+ $PausePopup.show()
+ Input.set_mouse_mode(Input.MOUSE_MODE_VISIBLE)
+
+
+
+
+func _on_QuitButton_pressed():
+ get_tree().quit()
+
+
+func _on_ResumeButton_pressed():
+ $PausePopup.hide()
+ get_tree().paused = false
+ Input.set_mouse_mode(Input.MOUSE_MODE_CAPTURED)