Finally, you'll need at least one ArcadiaHook.cs script in your main scene.  You'll then be able to build (play button) and connect to one of the repl

arcadia-unity/ArcadiaGodot

submited by
Style Pass
2022-07-06 19:30:03

Finally, you'll need at least one ArcadiaHook.cs script in your main scene. You'll then be able to build (play button) and connect to one of the repls or reload .clj files that have changed.

Note that these fns will be called with the parent of the ArcadiaHook instance as the first argument (the ArcadiaHook script inherits Node and would prevent manipulating any non Node properties on it's own node). For example if you are manipulating a camera you would attach the hook as a child like so:

You can hook functions to Godot nodes in clojure with hook+ and hook-. This has the same usage as Arcadia's hooks. Godot's hook types are :enter-tree :exit-tree :ready :tree-ready :process :physics-process :input :unhandled-input.

Signals are Godot's system for events. arcadia.core contains functions for working with signals: connect, disconnect, connected?, add-signal, and emit.

Most built in nodes emit a range of useful signals (like buttons being pressed, physics collisions). If you connect a var (like #'game.core/handle-newgame) you will be able to redefine the function in the repl.

Leave a Comment