I am trying to make Conway’s Game Of Life in Processing and everything works, but I want to have a textbox that shows how many generations have passed. I opted to use the text()
command, which looks as follows:
fill(255);
textSize(16);
text("Generation " + generations, 20, height - 15);
fill(0);
This does make the “Generations: x” text, but it doesn’t dissapear frame to frame, making it look like this by the ~10th frame:
I tried clear()
and setting the background to 0 at the start of each frame and that didn’t work. I even tried to draw a black rectangle over it before drawing the most recent text and that also didn’t work. I was thinking maybe it’s a text object, but that also doesn’t make sense. Any suggestions?