Author Topic: Keyboard controlled character movement question  (Read 225 times)

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.

Khris

    • Lifetime Achievement Award Winner
    •  
    • I can help with play testing
    •  
    • I can help with scripting
    •  
    • I can help with translating
    •  
    • Khris worked on a game that was nominated for an AGS Award!
Re: Keyboard controlled character movement question
« Reply #1 on: 25 Feb 2018, 17:06 »
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

Re: Keyboard controlled character movement question
« Reply #2 on: 25 Feb 2018, 18:26 »
Thanks a bunch, I’ll give that a try when I’m near my computer sometime this week!

Re: Keyboard controlled character movement question
« Reply #3 on: 28 Feb 2018, 06:57 »
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?

Khris

    • Lifetime Achievement Award Winner
    •  
    • I can help with play testing
    •  
    • I can help with scripting
    •  
    • I can help with translating
    •  
    • Khris worked on a game that was nominated for an AGS Award!
Re: Keyboard controlled character movement question
« Reply #4 on: 28 Feb 2018, 09:00 »
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.

Re: Keyboard controlled character movement question
« Reply #5 on: 28 Feb 2018, 12:58 »
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..!