Encounter: Handling joystick diagonals to climb up and down

Channel:
Subscribers:
675
Published on ● Video Link: https://www.youtube.com/watch?v=M_KE_7WGW5I



Duration: 0:00
40 views
5


The main issue with diagonals on joysticks is that you can pretty much never get it done atomically: If you try to go "bottom right", no matter hard you try you will 99% of the time activate either BOTTOM or RIGHT first and then only the second contact will be enabled.

In order to handle that, I added a small delay loop that waits for a few frames to see if an additional direction is enabled, the trick is to not have too long a delay so the normal NSEW navigation does not get slowed down significantly.