How to do charge attacks based on direction?

Godot Version

4.2.2

Question

How would I allow a fighting game charge attack to be done based on direction(for example, a charge input to the left could be done with up left, left, or down left)? I was thinking of splitting the directions based on horizontal and vertical and just checking whether either the horizontal or vertical is the same as the input sequence stored by each special attack and was wondering if there was a better way to handle this.

Nevermind. This can be done with a simple dictionary where for each state we want to round, we have an array of valid stick directions then just have a function that checks whether the input buffer direction falls within the desired charge direction

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.