Alphish / gm-community-toolbox

A collection of utility functions for GameMaker.
MIT License
33 stars 6 forks source link

instance_nearest_ext / instance_furthest_ext #56

Open biyectivo opened 1 year ago

biyectivo commented 1 year ago

The instance_nearest / instance_furthest functions include the calling object and only work with Cartesian distance. This can make checks on games (for state transitions, ranged weapons etc.) more difficult. Functions that extend this and make it easier can be implemented and can have the following signature:

instance_nearest_ext(x, y, obj, exclude_self = true, distance_function = distance_to_object)
instance_furthest_ext(x, y, obj, exclude_self = true, distance_function = distance_to_object)