Skip to main content

get_vector

Function get_vector 

Source
pub fn get_vector(
    left: KeyCode,
    right: KeyCode,
    up: KeyCode,
    down: KeyCode,
) -> Vector2
Expand description

Returns a direction from four keys. Up is -1.0 on Y (screen coordinates). The result is not normalized, so diagonals have length √2.