Moveing Diagonaly

You must understand the Game Editor concepts, before post here.

Moveing Diagonaly

Postby GuybrushThreepwood » Thu Oct 01, 2009 6:07 am

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:
Pirate: You fight like a diary farmer!
Guybrush: How appropriate, you fight like a cow!
User avatar
GuybrushThreepwood
 
Posts: 94
Joined: Sun Jul 06, 2008 12:23 pm
Location: Melee Island
Score: 2 Give a positive score

Re: Moveing Diagonaly

Postby skydereign » Thu Oct 01, 2009 6:26 am

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
User avatar
skydereign
 
Posts: 3510
Joined: Mon Jul 28, 2008 8:29 am
Score: 589 Give a positive score

Re: Moveing Diagonaly

Postby GuybrushThreepwood » Fri Oct 02, 2009 5:35 am

Yes it was just fixing the moonwalk, but those links helped thanks :mrgreen:
Pirate: You fight like a diary farmer!
Guybrush: How appropriate, you fight like a cow!
User avatar
GuybrushThreepwood
 
Posts: 94
Joined: Sun Jul 06, 2008 12:23 pm
Location: Melee Island
Score: 2 Give a positive score

Re: Moveing Diagonaly

Postby Superbeni » Wed Oct 07, 2009 4:55 am

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.
User avatar
Superbeni
 
Posts: 130
Joined: Sun Aug 02, 2009 1:23 pm
Location: Vienna, Austria
Score: 31 Give a positive score


Return to Advanced Topics

Who is online

Users browsing this forum: No registered users and 1 guest

cron