Godot Version
4.3
Question
Hello
I am working on my first Godot project a kind of city builder, and I would love have advices and help.
-
I have tried a code design like the Model–view–controller pattern (like the image) with a View Class that show informations and have the buttons, a class for the game logic called City and a class for the Neighbourhood that contains all informations about and extends the Sprite2D Class.
Is it a bad design ?
-
I could not find a way to add my Neighbourhood as child to Interface so I had to tweak it : The Neighbourhood class have a function to return the name of the texture depending of the Neighbourhood object properties and the View class loop on all Neighbourhood object and add them as children.
The Neighbourhood object can have some children : GPUParticle2D (smoke) or another sprite for show a specific Condition, but all of the code doing that is in the View Class so it’s a bit messy.
How can i fix that ?
Post Scriptum : all my assets are mine, they are not perfect maybe because i’ve made them in a presentation program.