Sprite Examples  ----  by Gary Neal, Jr. [garyneal_71@yahoo.com]

This directory contains some samle files that make use of the Sprite classes
that are available in the Game Library.  To make these EXE's just switch to
the directory where the MAKE.BAT and COMPILE.BAT files reside and type:

    MAKE SPR_EXPL\TESTSPR.CPP

This will create TESTSPR.EXE in the directory with MAKE.BAT (provided you
have you C compiler's directory in your system PATH).

A couple of test files available:

TESTSPR.CPP:

Uses the simplest version of the Sprite Class.  This Basic Sprite class
allows for pixel transparency, ownership or non-ownership of images,
dynamic memory allocation for image data, and (unlike most other sprite
libraries) dynamic memory allocation of the image array itself.  You can
change the dimensions of the images and the nummber of images that they
manage at any time without having to worry about memory leaks.  All the
memory management is transparent to the user, just create a variable of
type Sprite, check the InitOk flag and everything's set.

This Basic Sprite class does ot support image clipping along the edges of
the screen.  It is up to the programmer to ensure that the images stay well
within the screen boundaries to avoid "wrap-arounds" (as illustrated by the
test program) or worse, memory overwrites in areas of memory not meant for
overwriting (possible if vertical screen limits are exceed).

TESTCSPR.CPP:

Uses the derived version of the Sprite class called a Clipping Sprite
(class ClipSprite).  It inherents all the capabilities of the Basic Sprite
and adds the ability to clip the images along the Screen Boundaries.  You can
even set your own boundaries to limit the field of viewing on the screen.
You never have to worry about "wrap-arounds" or memory overwrites with this
type of Sprite.

My old Game Library had a Sprite Struct and a set of functions to implement a
Sprite Library for those of you who are not versed in C++.  In this new
library, I plan to do away with them in favor of the classes.  If anyone
feels that they really need them, let me know.

Gary Neal, Jr.
garyneal@geocities.com
garyneal_71@yahoo.com
http://www.geocities.com/SiliconValley/Park/7113/
