I have recently been coding a petri dish-type program that creates "cells" who interact and reproduce. However, if the program creates too many cells, it gets very slowed down and the frame rate drops significantly. I've looked into the problem, and it seems that creating a PShape for each cell and moving it with translate() may solve this problem. Previously, I have just been drawing ellipses continuously, but if I use PShapes instead, this ellipse can be saved and drawn more efficiently.
My problem is that many of the methods determining cell interaction are based on the cells' positions relative to each other. If I use translations and things like popMatrix() and pushMatrix(), will this mess up my methods?
Thanks for any feedback or solutions! Anything would help!