Here’s a tutorial I wrote on using components to help keep your code organized.

  • @mrsgreenpotato (2/2) and in our case, we’ve put every piece of data into resources where we export the values we need. If we need a node in a scene, we just export it and it’s mostly a direct childNode of the scene. All in all we have a system where the example zombie consists of the following components: Ai, Model, Stats, Info, Sfx, Chemistry. These have their own scenes that get added to the entityNode. In the end there’s no need for such a helper function basically :D (at least yet)

    • mrsgreenpotato
      link
      fedilink
      arrow-up
      1
      ·
      edit-2
      4 days ago

      Yes, as long as you know what components are inside the Zombie scene, then you can export it. But the idea of being more flexible is that you shouldn’t need to update the Zombie class when you add a new component to it. E.g. You want the zombie to be “Bumpable” now (for some reason :)), then you should be able to just add the Bumpable node to your Zombie scene and that’s it. With your approach, you’d need to also reference and export it in the Zombie class first.