When you have defined all of the structures and have established all of the links, you can call the animate() routine to move the objects. Animate() adjusts the positions of the objects as described above, and calls the various subroutines (animcroutines and animoroutines) that you have specified. After the system has completed the animate() routine, some gels may have been moved, so the gelsinfo list order may possibly be incorrect. Therefore, the list must be re-sorted with sortglist() before passing it to a system routine. If you are using collision detection, you then perform docollision(). Your collision routines may also have an effect on the relative position of the GELs. Therefore, you should again call sortglist() to assure that the system correctly orders the objects before you call drawglist(). when you call DrawGList(), the system renders all the GELs it finds in the gelsinfo list and any changes caused by the previous call to animate() can then be seen. This is illustrated in the following typical call sequence: struct AnimOb **myAnimKey; struct RastPort *rp; struct ViewPort *vp; /* ... setup of graphics elements and objects */ Animate(myAnimKey, rp); /* "move" objects per instructions */ SortGList(rp); /* put them in order */ DoCollision(rp); /* software collision detect/action */ SortGList(rp); /* put them back into right order */ DrawGList(vp, rp); /* draw into current RastPort */