package main import "core:math" import "core:math/linalg" import rl "vendor:raylib" angle_cycle :: proc(value, min, max: f32) -> f32 { delta := (max - min) result := linalg.mod(value - min, delta) if result < 0 { result += delta } return min + result } angle_rotate :: proc(angle, target, speed: f32) -> f32 { diff := angle_cycle(target - angle, -math.PI, math.PI) if diff < -speed {return angle - speed} if diff > speed {return angle + speed} return target } get_vec_from_angle :: proc(angle: f32) -> vec3 { return rl.Vector3RotateByAxisAngle(vec3right, vec3backward, angle) } draw_text_centered :: proc(font: rl.Font, text: cstring, pos: vec2, size: f32, spacing : f32 = 1, color : rl.Color = rl.BLACK) { text_size := rl.MeasureTextEx(font, text, size, 1) rl.DrawTextPro(font, text, pos, text_size / 2, 0, size, 1, color) }