aboutsummaryrefslogtreecommitdiff
path: root/src/input.odin
diff options
context:
space:
mode:
authoriamcheeseman <[hidden email]>2026-01-14 19:21:33 -0500
committeriamcheeseman <[hidden email]>2026-01-14 19:21:33 -0500
commitd6f276be6bc1214c88cfc5346ceb7a5bea610638 (patch)
tree9b1f4d1aa4a02f2855c14dea2bf440f58343cc0e /src/input.odin
parent1b8553bf96017795dcf081b78371c3b2a8d5ecc5 (diff)
i HATE physics bugs (i haven't fixed them yet)
Diffstat (limited to 'src/input.odin')
-rw-r--r--src/input.odin9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/input.odin b/src/input.odin
index 475be92..0b1d56e 100644
--- a/src/input.odin
+++ b/src/input.odin
@@ -18,6 +18,7 @@ actions: struct {
move_right: Keybind,
jump: Keybind,
dash: Keybind,
+ shoot: Keybind,
}
init_keybinds :: proc() {
@@ -25,6 +26,7 @@ init_keybinds :: proc() {
actions.move_right.input = .D
actions.jump.input = .SPACE
actions.dash.input = .LEFT_SHIFT
+ actions.shoot.input = rl.MouseButton.LEFT
}
is_keybind_down :: proc(keybind: Keybind) -> bool {
@@ -50,3 +52,10 @@ is_keybind_just_down :: proc(keybind: Keybind) -> bool {
assert(false)
return false
}
+
+get_mouse_pos :: proc() -> (mouse_pos: Vec2) {
+ mouse_pos = Vec2{f32(rl.GetMouseX()), f32(rl.GetMouseY())}
+ mouse_pos /= Vec2{f32(rl.GetScreenWidth()), f32(rl.GetScreenHeight())}
+ mouse_pos *= SCREEN_SIZE
+ return
+}