CSC 111: Introduction to Computer Science

HW 4: The Growing Fantasy Flower

Due Wednesday Feb 23 Midnight, via Moodle

SUBMIT as HW4.py

Office Hours Monday 2-3; Tuesday 1:30-2:30


Growing Fantasy Flower

For the homework, create a very simple animation of a flower, or something that could be interpreted as a flower, growing. Your fantasy flower should have a stem, a center part of the flower, some petals and two leaves. It can have more elements if you want to add them.

Many of you were dissatisified with the simple jumping animation suggested for the lab, and you made much more sophisticated animation - which is great! For this flower though, you can certainly have it grow in jumps, rather than a visually gradual growth. One possible solution program is Flower.py

  1. Your plant will start very small, with only a tiny stem and a small bud (which can be a circle or an oval).
  2. Then as the stem grows taller and gets a bit thicker, the flower center moves up with the top of the stem, and grows larger. This growing phase should occur over at least four or so stages (which should bring the 'for' loop to mind). You will need a growth rate for the stem, and perhaps a different one for the flower center.
  3. Once the plant has reached its mature height and size, add some petals around the flower center. These can be simple shapes, replicated with the .clone() method if that is useful. You DO NOT need to rotate these shapes to make the flower petals all perfectly radiating out from the flower center - just draw little shapes that could be interpreted as being petals, that are nicely spaced around your flower center. This will give you a good workout with your coordinate system.
  4. Finally add two leaves to the stem - which can be any shape.
In addition to those elements