mdsteele / azimuth

A metroidvania with vector graphics
https://mdsteele.games/azimuth/
GNU General Public License v3.0
51 stars 15 forks source link

additional keys to be used for controls #12

Closed lowagner closed 4 years ago

lowagner commented 4 years ago

hi! i think this game could be run on the Pyra -- i've done some cross-compilation so it looks like it could work fine, but i don't have a prototype on me (but will have a production version sometime this year, hopefully!).

at any rate, the controls on the Pyra include four shoulder buttons (L1/L2, R1/R2 are some type of shift, control, super (or meta, i'm not 100% sure), and alt. i forget exactly what they are, left or right alt, etc.), six face buttons (insert and delete for the small buttons, and home/end page up/down for the main four buttons), and of course a d-pad which is set up as the arrow keys. backspace is different than delete, but i understand there may be some weirdness on macs, so this may break existing configurations.

i'm happy to make any changes you think are necessary. one possible optimization -- we could ignore L/R distinctions and combine as one AZ_KEY enum value, also backspace/delete could come through as one like they used to. if we ignored L/R distinctions, the names would come through better on the set-key option panel (ALT, CTL, SHF, MET, SUP).

possible future directions

longer term, i would like to add additional "advanced" configuration -- or possibly just one for a Pyra build target -- where we allow a bomb or rocket to be dropped immediately when pressing a button, and possibly add some overloads for the ordnance changes.

suggested Pyra defaults:

L1: util                                       R1: fire
L2: drop bomb immediately                      R2: launch rocket immediately
         [up]                            [ins]         [pg up]
 [left]       [right]                              [home]    [end]
        [down]                           [del]         [pg dn]

i'm thinking [ins] would launch a rocket, [del] would drop a bomb (both immediately, just like L1 and L2), [pg up] could set ordnance to rockets, [end] could set ordnance to bombs; [home] would be "ordnance", and [pg dn] would be fire. there might be other valid configurations that people might want to set, but i wanted to see if this would be something you'd be willing to support/add in upstream, before i began work.

to be clear on the scope of the project, i'd like to add four more configurable buttons to the keyboard options menu:

the earlier two i assume are pretty simple additions, but the latter two would probably involve some extra code. not sure if you have a preference, but we could also do something like this for the support buttons (i.e. that affect ordnance type):

do you have a preference on either of these approaches, and what you might be willing to see in master? (i'm also happy to keep a fork.)

Thanks for your time!

mdsteele commented 4 years ago

Thanks for the interest; this seems like a really cool project!

Supporting more keyboard keys seems like a good idea in general, and I think this PR can be merged as-is. Not sure why I originally mapped delete and backspace to the same enum value (the backspace key on a Mac keyboard is labelled "delete", but it's still backspace). I think I left out modifier keys originally to avoid conflicting with system shortcuts (like cmd-Q to quit on a Mac), but eh, I see no reason not to give people the option.

As for the future changes you've mentioned:

(1) Adding new keys (e.g. allowing [0] and [9] to be customized) is also a reasonable idea, but will be more work. Off the top of my head:

(2) I'm a little more skeptical that the "fire rocket/bomb immediately" keys are needed; that seems to me like a bigger interface change than just remapping keys. If one of the shoulder buttons is used as the ORDN key, seems like holding that while pressing fire should be pretty easy? (FWIW, Metroid Fusion had a similar interface--hold a shoulder button and press fire to fire a missile--and I think it worked well.)