diff options
| author | LLLL Colonq <llll@colonq> | 2026-05-28 20:16:38 -0400 |
|---|---|---|
| committer | LLLL Colonq <llll@colonq> | 2026-05-28 20:16:38 -0400 |
| commit | fa4d63110a3e12d0242b6e6ddcded74d04480f28 (patch) | |
| tree | 330e6ccfe650f1fd9143f9db67b481d4c74a2e05 /2026/examples/godot/project/main.gd | |
Initial commit
Diffstat (limited to '2026/examples/godot/project/main.gd')
| -rw-r--r-- | 2026/examples/godot/project/main.gd | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/2026/examples/godot/project/main.gd b/2026/examples/godot/project/main.gd new file mode 100644 index 0000000..051ee04 --- /dev/null +++ b/2026/examples/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});") |
