Godot Version
4.4.1
Question
`I am making a Tower Defense game and learning more and more about Godot and GDscript as I go along. Now I managed to create the towers and enemies both of which have a base script TowerBase and EnemyBase which extend to the towers and enemies I create.
So far I have all of the values like speed, health, damage exported in the editor and can easily change those in the Base scripts, but I was thinking of creating Resources called EnemyStats and TowerStats to further break down the composition and make it so that in the Editor I can just change all of the stats only in one plase.
Would you say this is a good approach, what would be the most drawbacks from using this approach?`
Depends on how you create your enemies and towers. I feel it would be less useful for towers as you may want to extend their scripts to include more interesting functionality like area of effect attacks versus projectiles. I feel a base scene for enemies and towers of which to create new inherited scenes would be easier to manage.
I see Resources being useful to share common data between different scenes, but enemy and tower scenes should be unique in their data.
Well so far I just did the TowerBase and EnemyBase and extended the values from there.
I still have only one tower and I am just making the code work as I go along until it works properly. And I want to make some with splash damage and multi target. Would that be easier to control with a TowerBase script?
I have seen a lot of tutorials of using resources and since in my enemies I have a move component and health component I wanted to make the values easily changed in the editor.
But If I use resources I also read that the values are shared between resource so I may have to go back with the scripts as you mentioned.