Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: myname on Sat 06/10/2007 18:41:03

Title: Help with moving character
Post by: myname on Sat 06/10/2007 18:41:03
I have my walkable area one linear horiazontal line on every room ie. "Duty and Beyond".  The probem is I have to click exactly on the walkable line to move at all and since the resolution is low at 320x200 this is a annoying task to move the character.  Is there a way to get around this like having the player clck in the direction and have the character walk that way no matter if the they click on the walkable area line or not.  Any help woould be greatly appreciated.
Title: Re: Help with moving character
Post by: Khris on Sat 06/10/2007 18:57:56
The pathfinding expects walkable areas at least 3 pixels wide.

To solve your problem, intercept the Walkto-click in on_mouse_click:

  if (button==eMouseLeft) {
    if (mouse.Mode!=eModeWalkto) ProcessClick(...);  // default behavior
    else {
      player.Walk(mouse.x+GetViewportX(), player.y);
    }

    ..
Title: Re: Help with moving character
Post by: myname on Sat 06/10/2007 19:13:22
Thanks a lot KhrisMUC