Answer the question
In order to leave comments, you need to log in
How to choose the right design pattern in the game?
I'm making a small game (my first project) - sort of a turn-based roguelike.
Implemented the generation of the battlefield, the placement of monsters on it, the generation of power-ups and objects (the object is a spell that can be cast by spending mana).
I ran into the problem of adding spells to existing code - they are all different and the effect must be included in different parts of the code at different abstraction levels. For example, a spell that allows you to attack first - its effect comes into play when comparing initiatives in the combat calculation function. A spell that adds a % bonus to damage should do this inside the player's stats recalculation function, because the bonus should stack with others before rounding, Fireball should cancel the fight altogether ...
Studiedbook on design patterns . I learned a lot, everything is very cool - but I don’t know how to apply any of the described patterns to my situation.
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question