Collect items on passing
Implementation details:
Support a variable named auto_collect_radius. Numbers smaller than 0 mean do not autocollect, absence of the variable means do not autocollect.
When the player updates their position, trigger code that looks for all autocollectable items within auto_collect_radius, then runs the existing collect code on them.
You can wrap existing distance calculation code in a property method to be able to use it as filter.