Hi all hope youre well.
So Im very new at this and ive watched dozens of tutorials and I even made a simple game but it was mostly just me following along.
I have gotten to the point i want to have a better foundation when coding and I found that composition looked like what I was after. I could make nodes that were like HealthComponent, MovementComponent, etc. However I also saw resources looked really good for modularization too and want to use that, i.e. playerstats, enemystats etc.
The issue im not able to wrap my head around and videos arnt getting through my thick skull is how do i incorporate these things in the below example?
Say I have a HealthComponent, i put it on the player and i put it on an enemy. I assume they use the same thing because thats the point of the components right? Anyway i then have 2 stats files. 1 for player and 1 for enemy. How do I get the HealthComponent to use these without being tired to one or the other?? The tutorials ive watched had a HealthComponent that just had a default health value. How do I make a single component read from a resource file i want it to? Even if i have 100 diff ones and only one HealthComponent?