|Topic was automatically imported from the old Question2Answer platform.
So, I’ve had a question that I’ve asked before yet never knew how to structure it. Now that I know more about the engine, I’d like to try asking the question in a much better way.
In Godot, from what I’ve scene these class scripts need to be attached to a scene. I’ve thought of doing this two ways.
For one, I could have one sceen for each different item … but if the game has 1000 items, isn’t 1000 scenes too much?
I’ve also thought of having one scene, and like 1000 classes (one for each item). Then just instantiate the scene and attach a specific script to it when I need it… but I’m not sure how that would fair?
I’ve thought of using JSON but how do I make the JSON relevant when I still need a script for each item anyway. The json would have no information that each script would have anyway.
I’d like some thoughts please. Or if anything, would someone be able to explain how a system would be made anyway?
I’ve thought about this as well. When I want dozens of different classes with slightly different parameters and methods, I’ve just been making that many scenes. I usually generate them with a script, but it’s still dozens of files. I’d love to know a more elegant way to do it.
On the other hand, when I learned object oriented programming, I was generally told to make separate files for every class. So, maybe that’s just the way it’s meant to be.
duane | 2020-09-03 04:00
Honestly you’re probably right. I’m most likely just doing to do that unless someone comes here with a better proposal.
scarletred012 | 2020-09-03 04:16