Post ASxJXW0ufynF1ddIgq by hmans@norden.social
 (DIR) More posts by hmans@norden.social
 (DIR) Post #ASxJXV4QBS0O6EGaWG by hmans@norden.social
       2023-02-22T15:23:56Z
       
       0 likes, 0 repeats
       
       I'm enjoying this #GodotEngine pattern where I'm implementing different systems of a game as a collection of nodes that, through Dependency Injection, don't make any assumptions about the rest of the project.I can split up functionality into as many or few branches as I need, disable selected pieces of functionality without breaking the game, and don't need to rely on magic invisible autoload globals for event buses or somesuch.(I learned some of these things during my work with React :b)
       
 (DIR) Post #ASxJXVZyI9F5g51mhE by mshiltonj@universeodon.com
       2023-02-22T16:01:32Z
       
       0 likes, 0 repeats
       
       @hmans how do you pass "props" in godot? Is @onready var thing = $Thing or some other mechanism?
       
 (DIR) Post #ASxJXW0ufynF1ddIgq by hmans@norden.social
       2023-02-22T16:07:04Z
       
       0 likes, 0 repeats
       
       @mshiltonj If it needs to be configured from outside the branch starting with the node, I make it an @export variable. If the node has immediate knowledge of the dependency (maybe because it's a direct child), I grab a reference through the $ syntax (onload or not.)But I think the first part is the more important one. Accept input "props" as @export vars, and provide signals (and sometimes public functions) for interacting at runtime.
       
 (DIR) Post #ASxJXWTGyXTiRatwtU by Jdreben@mastodon.world
       2023-02-23T01:28:29Z
       
       0 likes, 0 repeats
       
       @hmans @mshiltonj I know you already said you were inspired by React but what you just described reminds me a lot of Svelte :) Good paradigm.