Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: Duckbutcher on Sun 25/02/2018 08:05:43

Title: Keyboard controlled character movement question
Post by: Duckbutcher on Sun 25/02/2018 08:05:43
Hi guys, hope you're all good today.

I have a keyboard controlled character running around in a top down maze type environment.
I'm currently using the “pressing” mode for arrow key control as in the keyboard movement script that comes with the default template.

My question is - if I'm holding for example up and left when I hit a wall (or rather the edge of the walkable area),how can I have the character continue moving left along the wall instead of stopping outright? Sort of the same way many characters in top-down games like Zelda move.

I hope this is clear enough! Cheers.
Title: Re: Keyboard controlled character movement question
Post by: Khris on Sun 25/02/2018 17:06:37
Not possible with the default module, since it simply calls Character.Walk().

You can try this replacement by me: http://www.adventuregamestudio.co.uk/forums/index.php?topic=42843
Title: Re: Keyboard controlled character movement question
Post by: Duckbutcher on Sun 25/02/2018 18:26:57
Thanks a bunch, I'll give that a try when I'm near my computer sometime this week!
Title: Re: Keyboard controlled character movement question
Post by: Duckbutcher on Wed 28/02/2018 06:57:39
OK, I've stuck your script into my game and am having a look around, but nothing obvious is leaping out that I can do to solve my problem. Any advice?
Title: Re: Keyboard controlled character movement question
Post by: Khris on Wed 28/02/2018 09:00:06
Right, sorry, I confused this with the character continuing to animate at the edge. I remember that I originally planned to add that to the module, but it's a bit more complicated than tile-based Zelda because in AGS, walkable areas don't have straight edges. They're just a bunch of pixels. You can infer the "angle" of the edge by looking at a few neighboring pixels, but it becomes a nightmare pretty quickly.
Title: Re: Keyboard controlled character movement question
Post by: Duckbutcher on Wed 28/02/2018 12:58:16
Ah darn, thanks anyway for the info and the module. If you do ever decide to put it in the module, please let me know..!