Combo Key Input
Posted: Tue Apr 16, 2019 10:35 pm
Hello,
I'm creating a 2d platformer for a class project.
I am attempting to implement multiple keystrokes to enable certain animations.
What would be the best method to implement something like this?
i.e. When I press 'shift' and 'd' the character will sprint in that direction. If only 'd' is pressed, a walking animation is played in that direction.
Also, what would be the best way to implement an animation chain?
Say for instance, I spam the 'e' button for an attack and the animation changes depending on how frequently the 'e' button is pressed. So the first time the 'e' button is pressed, one version of an attack animation is played. Then the second time the 'e' button is pressed immediately afterward, a second version of an attack animation is played and so on and so forth.
Essentially, I'm looking for some functionality you would see in Castlevania and Hollow Knight.
Thanks for any help and direction you can provide.
I'm creating a 2d platformer for a class project.
I am attempting to implement multiple keystrokes to enable certain animations.
What would be the best method to implement something like this?
i.e. When I press 'shift' and 'd' the character will sprint in that direction. If only 'd' is pressed, a walking animation is played in that direction.
Also, what would be the best way to implement an animation chain?
Say for instance, I spam the 'e' button for an attack and the animation changes depending on how frequently the 'e' button is pressed. So the first time the 'e' button is pressed, one version of an attack animation is played. Then the second time the 'e' button is pressed immediately afterward, a second version of an attack animation is played and so on and so forth.
Essentially, I'm looking for some functionality you would see in Castlevania and Hollow Knight.
Thanks for any help and direction you can provide.