[Contents] [Index] [Help] [Retrace] [Browse <] [Browse >]

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 */


[Back to Amiga Developer Docs]