Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: Icey on Thu 10/02/2011 03:05:28

Title: Walking senselessly
Post by: Icey on Thu 10/02/2011 03:05:28
Is there any way I can keep the player walking even when at the edge of the walkable area?

Like in most games you when walking if you come near a blockage of some sort you are still able to keep moving but still you can not pass.
Title: Re: Walking senselessly
Post by: Galen on Thu 10/02/2011 03:20:59
Welcome to the future, now its harder to do something half assed then it is to do it properly.
Title: Re: Walking senselessly
Post by: Icey on Thu 10/02/2011 04:08:57
Wow, Oh well. Thanks though.
Title: Re: Walking senselessly
Post by: Khris on Thu 10/02/2011 08:44:10
I guess you're using keyboard walking, right?

The thing is, doing it the way it is done in most RPGs more or less offered itself:

if the player presses up, down, left or right -> animate char with respective loop
if the character can actually walk in that direction -> move him a few pixels

You'll note that the above will automatically produce animated walking and the senseless walking at blockades.

Now, this can easily be emulated using AGS, the best way is to code it from scratch though.
Title: Re: Walking senselessly
Post by: Icey on Thu 10/02/2011 11:19:30
Ok so is possible. But I cant code from scratch :-\

It's cool though, I will live with out it.
Title: Re: Walking senselessly
Post by: Khris on Thu 10/02/2011 21:18:21
I've coded a replacement for the KeyboardMovement module.

Get it in the thread (http://www.adventuregamestudio.co.uk/yabb/index.php?topic=42843.0).

In game_start, put
  KeyboardMovement.SetMode(eKMModePressing);
  KeyboardMovement.SetEdgeAnimation(true);


Please put feedback relating to the module also in the module's thread.
Title: Re: Walking senselessly
Post by: Icey on Fri 11/02/2011 21:30:16
Oh, I guess I should try it out.

Although I am not using the keyboard only the mouse, however this may change later on and then I will add it.