In my simulation, there are spherical creatures, food, and viruses (which aren’t actual game objects, just a separate part of the same code). The creatures change color if they are infected, and I want them to be able to see and smell food and other creatures. Creatures have a diameter of one, and food has a diameter of 0.5. Creatures are shown in colors between red and green, and if they are infected, then their color gets a certain level of blue added, depending on a specific virus trait. These are the traits:
bool infected = false; float moveSpeed = 1f; float turnSpeed = 0.5; float sightRange = 2f; float scentRange = 2f; int otherInfected = 256; //range is 1 - 256. 1 means that the creature can tell if a creature is infected if it has 1 or more blue added to the rgb scale, and 256 means it can't detect it at all, as the rgb scale is 0 - 255.
I won’t include any other code because it is irrelevant to my current question.