Animating Object Sprites


Groupwork

Assume Dragonfly with sprites, i.e., the Sprite class with a draw() method already implemented:

  // Draw indicated frame centered at position (x,y).
  // Return 0 if ok, else -1.
  int Sprite::draw(int frame_number, Vector position) const;

Extended Object draw() to use Sprites.

  1. What state does an Object need to handle Sprites? So, what attributes are needed (and what type)?

  2. Write pseudo-code for Object draw().


Hand-in

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

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

Make sure to include the names of all group members.

Happy drawing!

– Mark