Drawing in Layers


Groupwork

Need ability to draw in layers - control order of Objects to be drawn. Draw these Objects first, then these objects second, ...

Assume this is called altitude.

  1. What code needs to be added to Dragonfly to keep track of an Object's altitude?

  2. Consider the below code:

    // Draw world bottom up, from 0 to MAX_ALTITUDE.
    WorldManager::draw() {

      ObjectListIterator li(&m_updates);

      while (!li.isDone()) {

        Object *p_temp_o = li.currentObj();

        p_temp_o -> draw();

        li.next();
      }

    }

This code doesn't do what we want. Fix it, providing code that does.


Hand-in

Have ONE person from each group submit the group's answers:

https://wpi.qualtrics.com/jfe/form/SV_2iqFNLEuyaDfIKG

Make sure to include the names of all group members.

Happy layer-ing!

-- Mark