7. DEMONSTRATION PROGRAMS


   Included in the sprites package is a series of seven demonstration programs, of which six (1-5 and 7) deal with ordinary sprites and one (number 6) deals with super sprites. Each program is listable, and the user is strongly recommended to experiment with these programs, trying to alter speeds, directions of movement, sprites plotted and so on. These programs are an ideal way to increase familiarity with sprites quickly. The user will then be better equipped to design programs of his own.

   Users should note that the final space-bar pressing in each demonstration causes the program to be listed on the screen. To repeat the demonstration, just type RUN. When examining the program, please note that the functioning of the last five lines of each is to perform the auto-listing.

Cassette users:

All the demonstration programs, with the exception of DEMO:6 and DEMO:7 may be run using:

   *RUN M/CODE
   CHAIN "DEMO:n"   n is the program number


DEMO:6 is run by:

   *RUN SS/CODE
   CHAIN "DEMO:6"


and DEMO:7 by:

   *RUN CODE_2
   CHAIN "DEMO:7"


Disc users

Disc users should call the programs from the menu. At the end of each demonstration the easiest way to move to the next is to access the menu again using Shift-Break.

The functions of the various programs are summarized briefly below.

DEMO:1   This simply plots a number of sprites on the screen, without movement.

DEMO:2   This moves the sprites around the screen, using the facility for displaying two images of one sprite to create an effect of animation for the cherry. The two images are plotted depending on whether the x co-ordinate of the position is even or odd. See section 5.2.

DEMO:3   This moves the seven main sprites (1 - 7) around the screen. It also demonstrates how it is possible to allocate the same shape to more than one of the sprites. All the clones (9 - 15, 17-23) take the same form as the sprites of their respective base numbers.

DEMO:4   This shows the movement of all of the sprites and all of the clones. The program must keep a record of where each sprite is, and this is done using PROCswapin and PROCswapout which assign the actual clone positions to their relative variables.

DEMO:5   This generates a repeat pattern of sprites. Normally, unless you use clones, it is not possible to have the same sprite in more than one position on the screen, since plotting it in a second position automatically deletes it from the first. A way round this is to re-initialize the variables every time the character is to be re-plotted. A CALL to P% achieves this.

DEMO:6   This demonstrates the use of super sprites, and shows one moving around the screen facing left or right depending on the direction of travel. There are other super sprites already defined in the machine code program and the user may like to experiment with them.

DEMO:7   This is a short sequence showing the use of sprites in combination with plot and fill graphics.