so i created this advanced version of the mitosis simulation challange (‘https://thecodingtrain.com/CodingChallenges/006-mitosis-p5.html’) and among others included a function to remerge the cells. It kinda works but in most cases one remerch causes a chain reaction which merges all the cells in the canvas. I tried for hours solving this. can anybody help??
plus i created it in my brother wis an html file. now that i pasted it in the editor i realised it has a lot of issues showing the objects without flickering.