I am working on a 2D action platformer and I am currently implementing an upwards slash.
For a normal horizontal slash, the player must press the attack button. For an upwards slash, the player must hold up and press the attack button.
I notice that when trying to do an upwards slash, players often press the attack button a few milliseconds before the up button, causing the player to do a normal slash rather than the intended upwards slash. It feels bad.
I am wondering what are some techniques I could use to get a more reliable-feeling upwards slash?
I considered waiting for some interval (for example, 20 milliseconds) after attack is pressed to see if up is pressed. If it is pressed in that interval, do upwards slash, otherwise do regular slash at the end of the interval. But this made the game feel unresponsive.
For a similar reason, I want the attacks to happen on button press rather than button release.