Make actor move one direction at a time.
rickyniko
Member Posts: 85
Hello, im in the process of making a game, and the actor is controlled by a virtual dpad.
i was wondering how to make it so the actor can only move 1 direction at a time
so Up, THEN down etc etc.
i dont want the player to have the abilty to press down up/left at the same time and have the actor traveling on an angle.
know what i mean?
i was wondering how to make it so the actor can only move 1 direction at a time
so Up, THEN down etc etc.
i dont want the player to have the abilty to press down up/left at the same time and have the actor traveling on an angle.
know what i mean?
Comments
so your the one that made PRANKSTAR, ahahaa, that one scared the heck out of my 10 year old sister ahahha :P good one
I'm thinking the math will look something like this:
`ceil(((VectorToAngle(joyCenter.x - joyTouch.x, joyCenter.y - joyTouch.y)-22.5)%360)/45)*45`
The order of "joyCenter" and "joyTouch" may need to be reversed in the VectorToAngle function. I'll test it on my lunch break...
by the way, if you can, try help out with my other topic, its really recent so it should be up there)