aboutsummaryrefslogtreecommitdiff
path: root/src/controller.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/controller.c')
-rw-r--r--src/controller.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/controller.c b/src/controller.c
index aa8d4d9..e52eec5 100644
--- a/src/controller.c
+++ b/src/controller.c
@@ -2,17 +2,17 @@
#include <raylib.h>
-b32 is_button_pressed(i32 btn)
+b32 is_key_pressed(i32 btn)
{
return IsKeyPressed(btn);
}
-b32 is_button_held(i32 btn)
+b32 is_key_held(i32 btn)
{
return IsKeyDown(btn);
}
-b32 is_button_released(i32 btn)
+b32 is_key_released(i32 btn)
{
return IsKeyReleased(btn);
}
@@ -22,10 +22,10 @@ vec2 get_dir_input(void)
fx32 cont_x = FP_TO_FIXED(GetGamepadAxisMovement(0, 0));
fx32 cont_y = FP_TO_FIXED(GetGamepadAxisMovement(0, 1));
- fx32 key_w = is_button_held(KEY_W) ? FIXED_POINT_ONE : 0;
- fx32 key_s = is_button_held(KEY_S) ? FIXED_POINT_ONE : 0;
- fx32 key_a = is_button_held(KEY_A) ? FIXED_POINT_ONE : 0;
- fx32 key_d = is_button_held(KEY_D) ? FIXED_POINT_ONE : 0;
+ fx32 key_w = IsKeyDown(KEY_W) ? FIXED_POINT_ONE : 0;
+ fx32 key_s = IsKeyDown(KEY_S) ? FIXED_POINT_ONE : 0;
+ fx32 key_a = IsKeyDown(KEY_A) ? FIXED_POINT_ONE : 0;
+ fx32 key_d = IsKeyDown(KEY_D) ? FIXED_POINT_ONE : 0;
// Either Gamepad or Keyboard control, not both!
if(key_w != 0 || key_s != 0 || key_a != 0 || key_d != 0){