
There are two projects in this repository, one for GameMaker: Studio ( gms1-control-scripts.gmx) and another for GameMaker Studio 2 ( gms2-control-scripts), so you'll need to have one of these editors installed in your machine. P.s.: I'm also using the approach script from Matt Thorson's Grandma Engine to test the movement controls. Use it on your project, game jam or whatever! No need to credit (though appreciated)! 😉 It's not a perfect scheme, still needs work and optimization, but it worked for me pretty nicely, and I hope it does work for you, or at least helps you reach your own control scheme scripts! 😄 There's also a global for each player, indicating if the user's using the "gamepad" or "keyboard" schemes.

BUT these scripts require the use of the obj_controlsAnalog object, which can be initialized when calling the bootstrap script (and setting use_analog to true). In addition to that, there's also the optional use of analog sticks, for which I've added scripts to also emulate the down, pressed and released states. There's support for movement keys (d-pad, WASD), start (enter), select (esc) and 8 action buttons for up to 4 players, though only the first player gets the mapping for keyboard out of the box. I kinda did some clean-room engineering to build these control scripts here, and ended up adding more stuff here and there, but it basically follows the same principles: each button has 3 states and, for each state we have a script (down, pressed and released). They were hugely inspired by how Derek Yu wrote control handling scripts for his game Spelunky Classic.


This repo contains some scripts I use to handle controller bindings on some of my games.
