You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, I've seen that a gamepad is mandatory, and that the "keyboard support patch" proposed here has a broken link.
Here are my changes in file controller.cpp:
vec3 gamepad_get_stick(int stick, constfloat deadzone = 0.2f)
{
// I've replaced all the original content of this function with the following:
vec3 pad(0,0,0);float am = 1.f;
if (IsKeyDown(KEY_RIGHT_SHIFT) || IsKeyDown(KEY_LEFT_SHIFT)) am*=0.5f; // use SHIFT to slow down/walkif (IsKeyDown(KEY_RIGHT_CONTROL) || IsKeyDown(KEY_LEFT_CONTROL)) am*=2.f; // use CTRL to speed upif (stick==GAMEPAD_STICK_LEFT) {
// use ARROW keys to move the characterif (IsKeyDown(KEY_RIGHT)) pad.x+=am;
if (IsKeyDown(KEY_LEFT)) pad.x-=am;
if (IsKeyDown(KEY_UP)) pad.z-=am;
if (IsKeyDown(KEY_DOWN)) pad.z+=am;
}
elseif (stick==GAMEPAD_STICK_RIGHT) {
// use the number pad to move the cameraif (IsKeyDown(KEY_KP_6)) pad.x-=am;
if (IsKeyDown(KEY_KP_4)) pad.x+=am;
if (IsKeyDown(KEY_KP_8)) pad.z+=am;
if (IsKeyDown(KEY_KP_2)) pad.z-=am;
}
return pad;
}
This works for me (I'm on Ubuntu Linux).
I'm not making a pull request. I've just posted my code here in case somebody is interested.
@orangeduck: feel free to close this issue whenever you want, and thanks for sharing the project!
The text was updated successfully, but these errors were encountered:
Thanks for the keyboard support. And I notice that strafe support is missing, which is quite simple. In case you just forgot that, here are my changes in controller.cpp:
booldesired_strafe_update()
{
//return IsGamepadButtonDown(GAMEPAD_PLAYER, GAMEPAD_BUTTON_LEFT_TRIGGER_2) > 0.5f;returnIsKeyDown(KEY_LEFT_ALT); // use left ALT to strafe
}
Hi, I've seen that a gamepad is mandatory, and that the "keyboard support patch" proposed here has a broken link.
Here are my changes in file controller.cpp:
This works for me (I'm on Ubuntu Linux).
I'm not making a pull request. I've just posted my code here in case somebody is interested.
@orangeduck: feel free to close this issue whenever you want, and thanks for sharing the project!
The text was updated successfully, but these errors were encountered: