Combat SystemI’m a fan of fighting games and platformers, and for this game I wanted to explore a 2d world while being able to string together combos. Because of this, I developed a system that allowed for the easy definition of a combo.
I leveraged Unity’s Scriptable Objects to define ComboNodes. A combo node defines an animation, an input, a timing window, damage, effects, and potential continuation combo nodes. This created a tree structure where nodes can branch out into different combos and where each leaf node signals the end of a combo. When the player presses a button, the combo manager checks the corresponding node’s children, and listens to see if the combo node input is pressed within the allotted time. This repeats until the player presses a button that isn't in one of the current node's branches or if the node reached is a leaf node. This made for an extensible, data driven combo system and allowed us to add new combos without having designers touch code. |