ad044 / LainTSX

WebGL implementation of the Serial Experiments Lain PSX game
GNU General Public License v3.0
492 stars 27 forks source link

add gamepad support #43

Closed retpolanne closed 1 year ago

retpolanne commented 1 year ago

Hello! Nice project :)

Since this is a PSX game, I was wondering if gamepad support could be added. I wanted to play that with my Dualshock 3 controller so that it feels like I'm playing it on a real PSX. Also, it feels clumsy for me using the keyboard (e.g. remembering the key mapping, etc).

I was wondering if this API can be used for so: https://developer.mozilla.org/en-US/docs/Web/API/Gamepad_API/Using_the_Gamepad_API

retpolanne commented 1 year ago

Since it can't be built locally, I can't really hack this together, but I believe duplicating this:

https://github.com/ad044/lainTSX/blob/948a2f874b543ff9da059994c03b0aa4722ea8b6/src/components/canvas/objects/InputHandler.tsx#L7

or adding some option for gamepad and using gamepad events instead of keyboard events. Then you could add keybindings and maybe assume that the person is also using a dualshock or similar?

ad044 commented 1 year ago

hello! it is something that i will eventually look into (one of my friends was interested in doing it aswell) - the problem here is that the project is going to be rewritten (again), so i'd rather avoid making any drastic changes.

one of the first priorities for the rewrite will be making building the game locally easy and accessible so adding extra functionality should become more doable. when that will happen i don't know - i'm working on something else right now unfortunately.

for now an alternative i've seen some people try is somehow mapping the controller to emit equivalent keyboard keys but i'm sure you've considered that already.