The if_distance gene allows MyKaryotes to switch genes on or off depending on how close they are to something else.Note that the search will only include objects within the MyKaryote's range of vision. If no matching objects are found, then this gene does nothing.
The syntax is exactly the same as that for the if_attribute_real gene, with the following differences.
The first argument is the type of object whose distance will be checked. This is a string with the following possible values:
The third argument is still a real value to compare against, except that here it is specifically a distance measured in pixels. For reference, the walls in MyKaryotes are about 16 pixels wide when viewed without zoom.
All other arguments are exactly the same as those for the if_attribute_real gene.