I'm attempting to create a player movement system where the direction is determined by the last pressed button. For example, if I press the left arrow key, the player moves left, then if I press the right arrow key while still holding the left arrow key, the player should switch direction and move right. If I release the right arrow key while still holding the left arrow key, the player should turn left again.
I've tried several codes using 'for' loops, but none seem to work correctly with tile movement.
here is the code: https://pastebin.com/QBwMiiam
Pastebin
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.