Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add analog support for the circle pad and c-stick #42

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

thearst3rd
Copy link

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!

@thearst3rd thearst3rd changed the title For the circle pad and c-stick, use analog values Add analog support for the circle pad and c-stick Jun 2, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant