Tech Work #3: Old Habits Die Hard


The last two devlogs were probably boring and uninteresting because the images for them weren't loading. I have fixed this problem and will continue forward using more images instead of typing up long uninteresting paragraphs.


Fixing the "Battle System" dependency problem:

Creating a BattleContext object in the top of the hierarchy and passing it to children using dependency interjection fixed the problem of everything being able to touch BattleContext.

Forgive me for this but i forgot to resize the diagrams again
This diagram displays a good relationship between objects.
I swear I'll get it right next time


The Battle object passes the BattleContext to only other object that directly depend on it. Unlike the 2nd image, only objects that have the green lines going to them from BattleContext have access to it. Using this method eliminates both the problems of having EVERYTHING access a critical part and having objects that need to interact with each other directly accessing the other.

Next devlog I'll be displaying overall how the system works through loosely connected objects and signals.

Leave a comment

Log in with itch.io to leave a comment.