Keyboard controlled character movement question

Started by Duckbutcher, Sun 25/02/2018 08:05:43

Previous topic - Next topic

Duckbutcher

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

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

Duckbutcher

Thanks a bunch, I'll give that a try when I'm near my computer sometime this week!

Duckbutcher

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

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.

Duckbutcher

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..!

SMF spam blocked by CleanTalk