evolution simulation

by pajamaclaws21
See Code Download Embed
artificial selection simulation!

hover over a circle and press space to kill it. when there is one circle left, it is designated as the next parent. the generation is over, and a new generation starts. in this new generation, each individual has a modified version of the parent genes (called "generational genes"). one individual in each generation has the exact generational genes.

genes are the following:
1 - initAngle: Angle turned each frame
2 - initSpeed: Steps moved each frame
3 - angleMod: Random modifier for angle turned each frame
4 - speedMod: Random modifier for steps moved each frame
5 - size
6 - color

formula for dist. from gen genes:
|mean(gen genes) - mean(my genes)| 

generally, if the color of a child is very different than the color of its parent, then it is very different

SPAGHETTI CODE WARNING --
idfienfojewn the code is ugly and inefficient, be warned if you're trying to modify it

Created February 22, 2023

Last updated February 22, 2023

Published February 22, 2023