1
General / Moving without using diagonal movement.
« on: February 18, 2016, 06:28:55 pm »
Hello!
So basically I'm trying to make my character move without using diagonal movement. As for the basic structure of the movement it is going good. Now the problem is control the movement.
What I want is that when you for example press down, the character moves down. If you then press right, while still pressing down, the character moves right, and if you release right, the character goes back to moving down.
I've been trying to create this with several if's in all possible ways, but it doesn't work as it's supposed to.
Any ideas on how to make it work?
So basically I'm trying to make my character move without using diagonal movement. As for the basic structure of the movement it is going good. Now the problem is control the movement.
What I want is that when you for example press down, the character moves down. If you then press right, while still pressing down, the character moves right, and if you release right, the character goes back to moving down.
I've been trying to create this with several if's in all possible ways, but it doesn't work as it's supposed to.
Any ideas on how to make it work?