Results 1 to 4 of 4

Thread: Walking with arrow keys

  1. #1
    Join Date
    Aug 2007
    Posts
    5
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default Walking with arrow keys

    So, I'm currently trying to create a auto fighter script for a game called Slayers Online (think LoZ: A Link to the Past for the SNES). It's a top down little game and it uses the arrow keys to move around. I was wondering if there was a way I could get my character to move to a monster. I know how to find a monster and it's coordinates, I just don't know how to get my character to move there.

    Any tips would be appreciated. I can probably figure it out of pointed in the right direction.
    Last edited by xRyuhou; 07-07-2012 at 05:01 AM.

  2. #2
    Join Date
    Jul 2008
    Location
    NSW, Australia
    Posts
    881
    Mentioned
    0 Post(s)
    Quoted
    3 Post(s)

    Default

    What I would do is have the what ever keys held down to go in which ever direction until you are parallel to it and than keeping the forward button held down while monitoring how close you are to the monster then releasing the button when in a certain distance

  3. #3
    Join Date
    Aug 2007
    Posts
    5
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by leetsxc View Post
    What I would do is have the what ever keys held down to go in which ever direction until you are parallel to it and than keeping the forward button held down while monitoring how close you are to the monster then releasing the button when in a certain distance
    Would I be able to monitor that through the coordinates? For example, if my character is at 334, 260 and the monster is at 386, 107, would I be able to do something like this (in pseudo-code (ish)):

    Code:
    if char x < monster x
    KeyDown(VK_RIGHT)
    else if
    char x > monster x
    KeyDown(VK_LEFT)
    and so on for the y coordinate? I know this wouldn't be all there is to it, but if there's something similar to this that I could do, what would be the best function to use for it?

    Thanks for the help, by the way.
    Last edited by xRyuhou; 07-07-2012 at 05:32 AM.

  4. #4
    Join Date
    Aug 2007
    Posts
    5
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Bump? I'm really stumped with this. :/

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •