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

Gamepad controller addition #11

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

Gytaco
Copy link

@Gytaco Gytaco commented Sep 14, 2024

This is my attempt to add the Gamepad.

I added the core Joystick logic to the Process, though, and it didn't have a performance hit.
Due to the continuous nature of Joystick input, this is the most reliable method in Godot. You could use the Physics Process, of course, but putting in Input leads to a very janky experience. This also allows the continuous control of the Camera in other areas like Wall Running, etc.

I added a Joystick on/off and a few other controls to better manage, as well as an invert. I decided to combine the RotatePlayer with mouse inputs rather than have 2 separate methods. If you wanted a hyper-performant option, it might be best to split them.

Lastly, all the input mapping has been added with the exception of the reset button still being 'r'

I made some design decisions, and while it's easy to put the logic in its own method if you prefer, I tried to keep it simple.

Lastly, I use Visual Studio so I added a gitignore just to deal with vs bloat when opening projects.

@theRealUnd3rdog
Copy link
Owner

I appreciate it, I'll merge this within the week

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.

2 participants