Godot Version 4.7.1
So I’m in the process of figuring out what things should be in a class and what things should be Components.
For example, I want an Entities speed stat to affect how fast they move or their strength stat to affect how much damage they do. From what I understand I would need to put any node that controls movement or attacks as a child of a node with the stats inside of it.
Stat Parent
@export_group ("Stats")
@export var Strength_Stat =: 10
@export var Speed_Stat =: 10
@export ...
Movement Child
@export var Move_Speed =: 8.0*(1+(Speed_Stat/10))
Attack Child
@export var Attack_Damage =: Weapon_attack+(Strength_Stat/2)
So would I make a “Stat Sheet” Class and have any Entity inherit that while movement and attack are components?
or
Do I make a “Stat Sheet” Component then have attacking and movement lumped into one class that pulls the variables from the component?
or
Do I just do Composition or Inheritance and not worry about using a mixture of both? I am quite new and I understand each one has it’s own uses but I’ve never taken a computer science class in my life and a friend of mine only has resources in German
I feel I’m just a couple of steps away from Tutorial Hell xD I understand that this kind of thing has more to do with coding efficiently/neatly than actually coding but I wanna make sure I get this right early in my project so I don’t end up in a mess later down the road. (I keep dreading I’ll become a Yandere Dev)
Also, what kind of node would I put the stats in? would it be a Character3DBody since Godot can’t Inherit from different kinds of nodes and I want stats to affect the movement or some kind of Control Node? I am programming what I want in theory just trying to figure out the order of things. I would need to adjust the stats between entities and in the case of the Player Character and co, They’d need to increase (I’m gonna iron out how later, xp or sphere grid or summin).
Thanks for reading, I understand people can write a full thesis on these things and spend years learning them but I’m on my 8th video of the day and making no progress