coderman64 / motobug-engine

A Sonic the Hedgehog-style game engine for the open web
https://coderman64.github.io/motobug-engine
18 stars 1 forks source link

Add control mapping features #5

Open coderman64 opened 2 years ago

coderman64 commented 2 years ago

Allow the user to remap the controls for the game, and save the configuration in browser localStorage.

It may also be a good idea to be able to set default keyboard/controller mappings in engine/config.js

pink-bot commented 2 years ago

do you want to be able to remap just the game controls or the dev mode controls as well?

coderman64 commented 2 years ago

Mostly the game controls. I've had a lot of people ask about that. The dev controls could be helpful too, but they aren't necessary, since the normal user should never have to use them.

pink-bot commented 2 years ago

which branch do you want to use for this change?

coderman64 commented 2 years ago

I'm not entirely sure what you mean by this...usually it is a good idea to have separate branches for each new feature, and merge those branches one by one.

pink-bot commented 2 years ago

I haven't really messed around with the menus yet (what should the options/controls menu look like) but I made a branch where the keymaps are moved to config.js

coderman64 commented 2 years ago

alright! Thanks a lot! The menus aren't really finalized in any way yet. The only one that I've made so far is the save/load screen. Overall, the visual style is based on Sonic Mania (of course), but any interface is fine as long as it works.

pink-bot commented 2 years ago

Ive got the next few days off so I can look at the current menu system and try to figure out how it works. Making something from scratch is beyond my skill level (along with collision detection and a bunch of other stuff you already implemented) currently.

pink-bot commented 2 years ago

What I'm trying to figure out how to do is create a new menu item next to the save files that will trigger a placeholder system of dialog boxes to set the controls one at a time but I still dont get how the menu items are coded or if I need to create a separate canvas.

Still messing with variables to figure out what they do.

coderman64 commented 2 years ago

Hey! If you don't want to mess with the interface stuff, I can do it at some point. The interface code is not really built in a way that can easily be extended unless you are open to writing basically an entirely new interface, so that probably isn't considered "good first issue" material, if that's what you're looking for.