How would I set up control keys?

Started by Camellias, Fri 25/11/2016 21:43:22

Previous topic - Next topic

Camellias

So I'm in the progress of a top down game, and I've searched it up in multiple places, trying to find and answer, but how would I set controls for the main character(s)? Like, using 'w' as the up key, 'a' as the left key, 's' as the down key, and 'd' as the right key? Thanks for any help someone can provide.

tor.brandt

#1
There is not one standard way of doing this, it is something you should put in your script.
If you are satisfied with keyboard movement a la King's Quest, you can simply use the "Default game" template when starting your game, since that template already has code for tap keyboard movement.

If you want "while key pressed" movement, you can either:

Use the module by Khris:
http://www.adventuregamestudio.co.uk/forums/index.php?topic=42843.0

Or the code by monkey424:
http://www.adventuregamestudio.co.uk/forums/index.php?topic=48167.msg636453360#msg636453360

These are just options found with a quick search of the forums - I think a more thorough search should yield a lot of other options as well, but one of the above should work just fine.

SMF spam blocked by CleanTalk