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

/claim #257 #339

Closed
wants to merge 2 commits into from
Closed

/claim #257 #339

wants to merge 2 commits into from

Conversation

Gyan-max
Copy link

@Gyan-max Gyan-max commented Dec 16, 2024

/claim #257
Problem Overview
The "Move with Player 1/2" block currently only works with keyboard inputs (e.g., WASD keys and arrow keys).
The goal is to extend this functionality so that the block can also work with gamepad inputs (such as analog stick movements or D-pad buttons) to allow for more flexible control options, especially for users who prefer using a gamepad.
2. Solution Overview
The solution likely involves modifying the existing block logic to incorporate gamepad support. Here's how that could have been done:

Input Type Handling: A new input_type parameter or method is added, which allows the system to determine whether the inputs should come from the keyboard or gamepad.
Gamepad Input Mapping: The standard Godot input system can be used to map gamepad buttons and analog stick movements. In Godot, the Input class can be used to detect gamepad inputs, such as:
D-pad or Analog Stick: Detect movement from the analog sticks or D-pad.
Gamepad Buttons: Detect button presses (e.g., A, B, X, Y on controllers).
Controller Input Logic: The code in the move_with_player_buttons method would be updated to check for gamepad inputs in addition to keyboard inputs, possibly by using Input.get_joy_axis() for joystick movement or Input.is_joy_button_pressed() for button presses.

Copy link

algora-pbc bot commented Dec 16, 2024

💵 To receive payouts, sign up on Algora, link your Github account and connect with Stripe.

@wjt
Copy link
Member

wjt commented Dec 17, 2024

Thank you for this submission but I have just accepted a preexisting implementation from #338.

@wjt wjt closed this Dec 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants