Hello,
I'm doing a Tactical RPG, and don't know if my architecture is right or not:
I have Board, Characters and Attacks nodes.
Attacks have a function effect(Character a, Character b)
and also take the Board singleton into account. I do this to be able to code every effect imaginable, that's easy when prototyping and allow for deep gameplay.
To do this, I created a singleton scene AttacksList. Every child of AttacksList extends from Attack, and implements effect(a, b)
Characters can have a list of Attacks, they have a @export var attacks:Array
Q1: Am I doing things right, is my architecture correct ?
Q2: I would also like to do it the enum way, like this:
AttackList, enum ATTACK_NAME {ATTACK1, ATTACK2, ATTACK3}, func getAttack(name:ATTACK_NAME ) -> Attack
- Attack 1, attackName = ATTACK_NAME .ATTACK1
- Attack 2, attackName = ATTACK_NAME .ATTACK2
- Attack 3, attackName = ATTACK_NAME .ATTACK3
- ...
but can't find a way to edit enum values in arrays in the editor, there is no enum type.
Should I just create an array of Strings in Character and transform them to enum values with ATTACK_NAME .get("STRING_ATTACK")
, but will lost the autocomplete feature ?
Q3: If Q2 is impossible, it seems also impossible to get a node_path of a singleton from the editor, is it true ? In this case, should I just put the AttackList in the main scene ? (this is not optimal since other scenes like the perk selector will need to access the AttackList too)
Q2-3: Is C# generally more suitable in cases where the gameplay logic rely heavily on OOP ?
Thank you in advance ^^,
sorry if my explanation was messy, I am not a godot master