genba-games / morsemadness

Transmission team ADKL
https://berith.itch.io/m-m
GNU General Public License v3.0
5 stars 1 forks source link

Keymap is not properly configured. #2

Closed berithpy closed 6 years ago

berithpy commented 6 years ago

For some reason both players share the action key. Enter and Space

AlejoAsd commented 6 years ago

This is due to the gamepad keymaps having both controller and keyboard inputs in the same array. The Gamepad class checks each array of either buttons or keyboard keys in the keymap, and tries to check if either the keyboard or the controller are pressing any of the keys contained in the array.

Phaser.Keyboard.ENTER has the code 13 assigned to it. One of the controller button identifiers is also using code 13. As such, when the ENTER key is pressed the gamepad is registering that both the correct input is being pressed, as well as the input that contains the controller button with the same code.

Splitting the array for each action (UP, DOWN, LEFT, RIGHT, ACTION) into an object with two arrays (one for the keyboard, one for controllers) and using the corresponding Phaser input function for each should fix this problem.

It does make the keymap format more convoluted however. :-1:

berithpy commented 6 years ago

Since keyboard controls are more for debug purposes than to actually play the game, should we just change the buttons to letters?

AlejoAsd commented 6 years ago

I disagree that they're only for debug. We'd be excluding a lot of people only supporting controllers officially.

I do agree that changing the binds would be an instant fix for now.

berithpy commented 6 years ago

Since keymaps overlap eachother we should probably implement a keymap selector in a menu or something similar, that way we stop bidning multiple keys/kind of keys to multiple actions, i feel like the gamepad logic is well suited for something like this

AlejoAsd commented 6 years ago

You mean like selecting input type between keyboard/controller? That sounds good!

berithpy commented 6 years ago

between pads too! since we've been having trouble with the generic gamepads and the ps4 one

berithpy commented 6 years ago

Changed Keyboard controls to wasdqe and ijkluo for now!

berithpy commented 6 years ago

I'll open a new issue for the gamepad menu.