Add gamepad support to woodeneye-008
This needs to be adjusted to match the SDL coding style.
This needs to be adjusted to match the SDL coding style.
Could you clarify what needs changing?
What I had in mind while writing the original example was to convey the following two messages to anyone reading the code:
- You’ve seen joystick splitscreen before, that’s nothing special. But did you know that Mouse+Keyboard can do local splitscreen too?
- Look how little code it takes to get something like this working!
While adding additional device support is technically an improvement, the extra complexity adds a little bit of additional cognitive load to the reader of the example, while not conveying the strictly minimum requirement.
It also somewhat distracts from the uniqueness of mouse/keyboard splitscreen, I’d opine that a pointed omission of joystick support actually showcases the mouse/keyboard functionality better by distancing itself from traditional joystick implementation paradigms.
I think multi-joystick would be better suited to a separate standalone demo, maybe one with a top down cooperative platformer format. It would also better show off the analog directional capabilities of the thumb sticks instead of shoehorning them into a WASD control scheme.
That's fair feedback, and since @ccawley2011 seems to be away, I'll go ahead and close this for now.
I probably ought to mention that the main reason for this PR is to better support systems like the 3DS, which doesn't have a keyboard and therefore requires this PR in order to allow input to work at all.
I probably ought to mention that the main reason for this PR is to better support systems like the 3DS, which doesn't have a keyboard and therefore requires this PR in order to allow input to work at all.
In that case, can you clean up this PR based on our feedback, and I'll go ahead and merge it?
I rebased this to the latest in revision control and fixed up some things based on feedback. Can y'all take another look over this and see if it's ready to merge?
Still feels kinda shoehorned, I wonder if it could be simpler if joystick is made mutually exclusive with mkb, and have a unified sample_inputs function that returns two vectors representing the intended movement magnitude and the integrated angular displacement?
it also feels like it’s just not a very good showcase of joystick usage in general, I have something sketched up in mind of a separate example that I think would work better as demonstration of how to utilize joysticks.
it also feels like it’s just not a very good showcase of joystick usage in general, I have something sketched up in mind of a separate example that I think would work better as demonstration of how to utilize joysticks.
I have no ego in this (and I assume @ccawley2011 doesn't either)...take a totally different approach and I'll happily close this PR unmerged. :)
I have something sketched up in mind of a separate example that I think would work better as demonstration of how to utilize joysticks.
Oh, I just reread this...a separate example that does something better with joysticks is definitely welcome, but I'd like to get something into Woodeneye, for consoles that only have joystick input, even if it's not perfect.
If we can get this patch in a state that is less "shoehorned," let's still do that. I'm also okay with merging this as-is and then improving the approach from there in further commits.
Aside from the above suggestion to split off the movement vector to its own utility function that incorporates all input methods into its calculation, a question: are there any platforms that have only the right joystick without a left counterpart?
The Sony PSP has the opposite problem: an analog left stick and no right stick. :)