feat: added compositeaxis1d_from_keys and from_buttons
This required moving InputDelegateFn from input.h to input_axis.h
This commit is contained in:
parent
1dc6f8352a
commit
aca01507ed
4 changed files with 21 additions and 12 deletions
|
|
@ -38,16 +38,8 @@ impl_PhysicsEntity_for(Player,
|
|||
|
||||
static inline
|
||||
void Internal_PlayerInitInput(Player* self) {
|
||||
playerinput_add(self->playerInput, CompositeAxis1D_as_InputAxis(compositeaxis1d_new(
|
||||
KeyBind_as_InputAxis(keybind_new(SDL_SCANCODE_A)),
|
||||
KeyBind_as_InputAxis(keybind_new(SDL_SCANCODE_D)),
|
||||
InputEvent_Float)), (InputDelegateFn)PlayerHorizontalInput);
|
||||
|
||||
playerinput_add(self->playerInput, CompositeAxis1D_as_InputAxis(compositeaxis1d_new(
|
||||
KeyBind_as_InputAxis(keybind_new(SDL_SCANCODE_S)),
|
||||
KeyBind_as_InputAxis(keybind_new(SDL_SCANCODE_W)),
|
||||
InputEvent_Float)), (InputDelegateFn)PlayerVerticalInput);
|
||||
|
||||
playerinput_add(self->playerInput, CompositeAxis1D_as_InputAxis(compositeaxis1d_from_keys(SDL_SCANCODE_A, SDL_SCANCODE_D)), (InputDelegateFn)PlayerHorizontalInput);
|
||||
playerinput_add(self->playerInput, CompositeAxis1D_as_InputAxis(compositeaxis1d_from_keys(SDL_SCANCODE_S, SDL_SCANCODE_W)), (InputDelegateFn)PlayerVerticalInput);
|
||||
playerinput_add(self->playerInput, KeyBind_as_InputAxis(keybind_new(SDL_SCANCODE_J)), (InputDelegateFn)PlayerAttackInput);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue