Page 1 of 1

Moveing Diagonaly

PostPosted: Thu Oct 01, 2009 6:07 am
by GuybrushThreepwood
I need help (Duh). In my game, the actor moves in all directions by use the arrow keys, but I can't figure out how to make the actor move diagonaly. Can anyone help? :mrgreen:

Re: Moveing Diagonaly

PostPosted: Thu Oct 01, 2009 6:26 am
by skydereign
The actual movement should be simple enough, so you probably mean how to prevent moonwalking? In that case you can look here, there is an explanation to antimoonwalk code and an example of 8-Way antimoonwalking, though I may update it, as the STATE method is better suited for it. If you did mean just the movement, then each keydown is set to the movement, and so when both are pressed, then it works. If you have any questions or want to see a demo, I think I can put one up.
http://game-editor.com/Moonwalking
http://game-editor.com/8-Way_Movement

Re: Moveing Diagonaly

PostPosted: Fri Oct 02, 2009 5:35 am
by GuybrushThreepwood
Yes it was just fixing the moonwalk, but those links helped thanks :mrgreen:

Re: Moveing Diagonaly

PostPosted: Wed Oct 07, 2009 4:55 am
by Superbeni
To move an Actor diagonaly, you have to move it on x and y axis.
If 2 arrow keys are pressed, it should moves diagonaly, if one is pressed, it moves "normal".
I hope this helps.