Godot Version
4.4.1
Question
I do not understand how to structure a class in Godot
I recently tried to add some test from the GDUnit addons and I realized my class couldn’t really be initialized.
Here is the main class of my game playedGame which is pretty much an abstract class (yes I know it’s coming in next release) it has most of the logic to make my game work, the subclasses being the different types of game modes. All using the parent’s logic to work.
But when trying to make a new PlayedGame I realized I can’t because it depends on those children nodes but if I remove those children nodes then the game can’t really make sense because the game mode needs a camera and a background ! The other two nodes could be made in code but it’s more readable this way.
What I am really asking here is how to manage graphical component and code component. Should I separate it entirely ? Should I do this approach which well, works, but makes it so that the only way to instance my class is to call its resource ?
I’m really confused about the best practice and if there even is a clear way to solve this problem.
Thanks !