Function within_distance

Source
pub fn within_distance(a: Vec2<i32>, b: Vec2<i32>, distance: i32) -> bool
Expand description

Checks if the distance between two positions is less or equal to distance.

When comparing world position distances prefer using this method, as i32 will overflow for big worlds.