Hello, I’m new to game programming and I’m trying to make a 2D game where the player can jump in a specific direction by holding the jump key.
So if the player holds the jump key, the X delta should go from 0 to 1 and 1 to 0 (0 is left, 0.5 is middle and 1 is right), back and forth while the key is being hold. So basically if I hold the key, the direction should do left=>middle=>right=>middle=>left=>…
Do you have any idea how to increment when the delta hits 0 and decrement when it hits 1 while the jump key is pressed?