summaryrefslogtreecommitdiff
path: root/2026/examples/example_godot/project/main.gd
diff options
context:
space:
mode:
authorLLLL Colonq <llll@colonq>2026-06-18 16:15:46 -0400
committerLLLL Colonq <llll@colonq>2026-06-18 16:15:46 -0400
commitc9fc2ca532c5219a087924ece1e38be19c25f006 (patch)
tree7c9d8e32617fab6e6179fe70893a3027714ea4e7 /2026/examples/example_godot/project/main.gd
parent068f3b9dc0522b03af534479cfa300a720ae86fa (diff)
Update
Diffstat (limited to '2026/examples/example_godot/project/main.gd')
-rw-r--r--2026/examples/example_godot/project/main.gd16
1 files changed, 16 insertions, 0 deletions
diff --git a/2026/examples/example_godot/project/main.gd b/2026/examples/example_godot/project/main.gd
new file mode 100644
index 0000000..268afbc
--- /dev/null
+++ b/2026/examples/example_godot/project/main.gd
@@ -0,0 +1,16 @@
+extends Node
+
+# Called when the node enters the scene tree for the first time.
+func _ready() -> void:
+ JavaScriptBridge.eval("window.parent.postMessage({op: \"ready\"});")
+
+var started = false
+# Called every frame. 'delta' is the elapsed time since the previous frame.
+func _process(delta: float) -> void:
+ if !started && JavaScriptBridge.eval("window.lcolonqJamStart || -1.0") > 0.0:
+ started = true
+ JavaScriptBridge.eval("window.parent.postMessage({op: \"started\"});")
+
+func _input(event) -> void:
+ if event is InputEventMouseButton:
+ JavaScriptBridge.eval("window.parent.postMessage({op: \"done\", win: true});")