Each creature carries a heritable coat color (r,g,b) and two behaviour genes (metabolism, activity). Every frame it loses energy to heat, proportional to how dark its coat is, and gains energy only while standing near an oasis:
heatPenalty = (255 โ brightness)/255 ยท 0.5 ยท heatIntensity
fitness = max(0, energy/100 โ heatPenalty)
At the end of each generation the population is ranked by fitness; only the top selection strength fraction survives to breed. Offspring average their two parents' genes and then apply a random mutation scaled by the mutation rate slider โ so a strong heat intensity with tight selection converges the herd toward pale coats fast, while a loose selection keeps diversity high.