There is a pretty confusing logic, when multiple arrow keys are pressed. Pressing left and right simaltaneously evaluates to walking right. So right gets priority before left. If you then add up or down, you keep walking right plus the third direction.
Pressing up and down moves the character up. Adding the right arrow key, adds movement to the right. Adding the left arrow key does add movement to the left, but also changes vertical movement to down. Somehow pressing left overrides the "up before down" priority. This is strange!
Pressed arrows in red. Direction in yellow.
Also pressing all 4 arrow keys evaluates to walking up right. So the priorities we see from pressing two opposite directions are back in order. The "Up, Left, Down" case is very peculiar!
Any ideas how the underlying code could look like, so that such a behaviour could emerge?
External link →