Add analog support for the circle pad and c-stick #42
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Apologies for the duplicate pull request, I was renaming branches and that accidentally closed the original PR.
========
This pull request adds support for analog input when using the circle pad or c-stick to move or turn.
The general approach I took is:
When checking for key presses related to moving or turning, first check if that "key" is an analog key
If it is, multiply the speed by that analog value - so that you can move/turn at slower speeds if the stick is held only partially down.
This means that you can just bind the controls normally using the menu, and in game, it will use the analog value. It also does not prevent the analog controls from being used as normal binary inputs, those still work.
My one concern with this is that I am now introducing floating point math into this - I'm not too familiar with the 3DS so I'm not sure how optimized it is for floating point math, but this doesn't introduce any noticeable speed penalty for me (at least on my New 3DS. Should be checked with an Old model but I don't have one). Let me know if we should tweak around this.
Using this patch, I could bind the circle pad to move+strafe, and the New 3DS c-stick knub to turn, and the controls felt great!