I have this program wrritten up, it works ok but the stem and flower grow at different rates. How can i make the two grow at the same rate? I have been struggling with this for a day or two now and I know it may seem simple, but its been a pain to me 😛
Share
The reason that you cannot easily sync the two animations is because the stems are growing based on the frameCount and the flower was growing based on a ratio that was not based on the frameCount or frameRate. I have modified your Flower class, very quickly to illustrate where the issue is:
before anything is called in
Flower.display()method:This is similar to how you are scaling the stems.
in the
Flower.grow()method:This is sloppy but quick. Just forces the flower to draw at its largest size, while the modification above scales it.
Here is the full source, with comments and commented out code: