reformatted player input calls

This commit is contained in:
Sara 2023-11-11 12:57:44 +01:00
parent b7a370c820
commit fb53954205

View file

@ -41,22 +41,19 @@ void _internal_player_init_input(Player* self) {
InputEvent_Float InputEvent_Float
)), (InputDelegateFn)player_input_h); )), (InputDelegateFn)player_input_h);
// JUMP // JUMP
playerinput_add(self->player_input, playerinput_add(self->player_input, KeyBind_as_InputAxis(
KeyBind_as_InputAxis(keybind_new(SDL_SCANCODE_W)), keybind_new(SDL_SCANCODE_W)
(InputDelegateFn)player_input_jump ), (InputDelegateFn)player_input_jump);
);
// CONTROLLER ------------------------------------------------ // CONTROLLER ------------------------------------------------
// WALK // WALK
playerinput_add(self->player_input, playerinput_add(self->player_input, ControllerAxis_as_InputAxis(
ControllerAxis_as_InputAxis(controlleraxis_new(0)), controlleraxis_new(0)
(InputDelegateFn)player_input_h ), (InputDelegateFn)player_input_h);
);
// JUMP // JUMP
playerinput_add(self->player_input, playerinput_add(self->player_input, ControllerButton_as_InputAxis(
ControllerButton_as_InputAxis(controllerbutton_new(SDL_CONTROLLER_BUTTON_A)), controllerbutton_new(SDL_CONTROLLER_BUTTON_A)
(InputDelegateFn)player_input_jump ), (InputDelegateFn)player_input_jump);
);
} }
Player* player_new() { Player* player_new() {