[Contents] [index] [Help] [Retrace] [browse <] [Browse >]

For faster collision detection, the system uses the borderline member of
the vsprite structure. borderline specifies the location of the horizontal
logical-OR combination of all of the bits of the object.  It may be
compared to taking the whole object's shadow/collision mask and squishing
it down into a single horizontal line.  You provide the system with a
place to store this line.  The size of the data area you allocate must be
at least as large as the image width.

In other words, if it takes three 16-bit words to hold one line of a GEL,
then you must reserve three words for the borderline.  in the vsprite
examples, the routine makevsprite() correctly allocates and initializes
the collision mask and borderline.  For example:

    WORD myBorderLineData[3];  /* reserve space for BorderLine */
                               /* for this Bob */

    myVSprite.BorderLine = myBorderLineData;  /* tell the system */
                                              /* where it is */

Here is a sample of an object and its borderline image:

              011000001100    Object
              001100011000
              001100011000
              000110110000
              000010100000

              011110111100    BorderLine image

Using this squished image, the system can quickly determine if the image
is touching the left or rightmost boundary of the drawing area.

To establish default borderline and collmask data, call the initmasks()
function.