Hello GDQuest community,
Simple question: What is the cleanest way to keep track of something like an integer called power_level?
Originally I wanted to keep it on the player node themselves, and pass it using a setter function to the player's child node: spell_manager.
Part of the setter function of spell_manager will then update each spell in use to use the appropriate integer value of the current power_level.
This seems too complicated though. Is there not a way to have the player hold onto his own power_level and then when necessary, each spell asks "What is the current power level?"
I guess this is an issue of can children classes start asking questions (calling functions probably) of their parents and grandparents. I've run into this question before and just designed lots of passing information downstream but non upstream.