SINCLAIR PROGRAMS, December 1984
================================


CHARLIE (aka. Warehouse Survival)
by A. Davies
from Sinclair Programs, December 1984

HELP the workman reach the exit by climbing onto the girders which a deranged
crane driver tries to drop on him. The exit is quite high so the girders need
to be used as stairs. Be careful not to be trapped between two girders, as
you may find that the crane driver can then hit the workman. Warehouse
Survival was written for the 16K Spectrum by A Davies of Neath, Glamorgan.


**********************************************************************


MOUSE MAZE

The mouse is caught in a maze of blocks joined by bridges. To win the game he 
must step on every block in the maze to change its colour. The bridges in the 
maze continually move, thus changing the structure of the maze and blocking 
off paths. If the mouse is caught by the cat he loses a life. In an emergency 
press M to appear in another part of the maze but doing so will reduce your 
score by 10%.

Mouse Maze was written for the 16K Spectrum by Anthony Sherwood of 
West Bromwich, West Midlands.


**********************************************************************


POT BUILDER

When the program is RUN you will be asked to enter the number of sections in 
the pot, up to a maximum of ten. You then have to input values for the radii 
of the circles which make up the sections of the pot. These are drawn as 
ellipses to build up a 3-D shape. Try experimenting with the following pot 
using ten sections and the radii values given: 
40, 10, 3, 3, 3, 3, 30, 40, 40, 40.

Pot Builder was written for the 16K Spectrum by W. Crowther, of Horsham, Sussex.


**********************************************************************


SPRITE CREATOR
by Roger Allen
from Sinclair Programs, December 1984


SPRITE DESIGNER


THIS SUITE of programs was written for the 48K Spectrum by Roger Allen
of Gerrards Cross, Buckinghamshire. The programs allow you to design
and animate sprite graphics which are as many as 16 pixels by 16
pixels in size. The best approach to entering and running the listings
is as follows.

Firstly, enter listing one. This is the main Basic program for
generating sprites. You cannot yet run it, as a machine code file is
required. Check it thoroughly, and save it to tape as file S-GEN.

Enter and run listing two. This creates the machine code file
SPRITE-MC to be called by S-GEN. The program dumps the machine code
file which will follow S-GEN on tape. This utility program is now no
longer required so you can NEW it, or transfer it to a separate tape.

Run the main program S-GEN, by loading it back from tape. It will
automatically call SPRITE-MC. Use cursor keys to move around the grid.
Keys 0 and 1 set and erase squares. You could begin to design a sprite
at this point but, on your first run through, continue with the
demonstration instead.

Enter and run listing four. This contains the data for two sprites
(spiders) which will be SAVEd for you in machine code file S-SPIDER
when RUN. Record this on tape directly after SPRITE-MC. This utility
is now no longer required so either NEW it or record it on a separate
cassette.

In order to run the spider demonstration, reload the sprite generator,
press LOAD, and answer yes to the Load sprites? question, and no to
the Load sequences? question. The name to be entered is S-SPIDER, and
the answer to Where to? should be 1. Then LOAD from tape.

At this point you should be back at the main menu. Try these steps.
Press "R"etrieve and ask for sprite 1. This will show the design for
the first sprite, together with its data. Check this with listing
four. Each sprite is like four user-defined graphics with 32 BINary
lines.

Use the "I"nvert option to turn the sprite round or invert it, and
then "F"ile the new design as sprite three. Only now will data for the
new design be given. Repeat these steps for sprite number two. You can
create up to 32 sprites in this way. You can now "A"nimate. The table
of sprites is displayed, with two sets of figures at the bottom.

Change the attributes by entering "y" in response to the prompt. The
number of steps is the number of sprites to be included in one
animation, with one frame per sprite. The maximum is eight, but enter
two on your first run through.

The displacement is the number of pixels to be moved between each
frame. The maximum displacement is four, but enter one for a
demonstration.

Speed allows you to select an animation speed between one and six, and
colour allows you to choose a colour between one and seven. Now answer
"n" to the Change attrs? question in order to move on to sequences.

Enter "y" to the question Change sequences? You can now select the
sprites to be included in each rotation. Although this demonstration
uses the same sequence for each direction, any selection can be made
in any order. For a simple demonstration, press ENTER in answer to U,
as you should already have selected one and two. For D, L and R,
answer "1" to No. 1, and "2" to No.2. Do not elect to change the
attributes or the sequences. You can now control the animation with
the cursor keys (5-8). Key 4 will hold it steady.

Press "x" to return to the main menu, and try building up your own
library of sprites by LOADing and SAVEing.

To see how to use the sprites in a Basic program enter listing five
but do not run it. Check it, and dump it to cassette with the file
name S-DEMO.

Enter and run listing three. This loads the SPRITE-MC code, so you
will have to rewind the cassette to the second file. This program will
dump a modified machine code file to tape, which you should place
directly after S-DEMO. This utility is now no longer required, so NEW
it, or record it on another cassette.

You can now rewind and rerun S-DEMO. This calls the modified machine
code file S-BASIC MC. It will then require the S-SPIDER file, so
rewind to the start of the third file for this.

This is just a demonstration of using Sprites in a Basic program. For
your own programs you will only need lines 10 and 9000 onwards. To use
sprites in your own programs, first design the sprites using the main
program. Make a note of their numbers with reference to the sprite
table and save them to cassette.

Load in the demonstration program, which will load in the appropriate
machine code. Load the sprites you wish to use, using LOAD "" CODE.

To use the sprites, the routine at line 9000 must be called. First,
though, you must set up a number of Basic variables.

X2 and Y2 hold the new coordinates of the sprite which has just been
loaded. Variables X1 and Y1 hold the old coordinates of the first
sprite.

Calling the routine will take the first sprite and plot it at position
X1, Y1. As the first sprite should already be on screen in that
position and plotting sprites is done in the same way that plotting is
done in Basic, this will effectively delete the first sprite. The new
sprite is then printed at X2, Y2, and control is restored to the point
at which the routine was called.

Notice that when a sprite is first printed on screen, it does not have
an old position, so X1 and Y1 must be set to 255 so that no unplotting
takes place.

Once control has been returned to the body of the program, X2 and Y2
should be stored as X1 and Y1, and the second sprite should be treated
as the first sprite.

For example, if you wanted to print sprite 3 at position 100,100 and
then replace it with sprite 5 at position 100, 105; you would let
X1=100, X2=100, Y1=l00, Y2=105, S1=3 and S2=5. You would then instruct
the computer to GOSUB 9000.

If sprite five were to appear at the beginning of the game in position
100, 105; you would enter: X1=255, Y1=255, S1=5, X2=100, Y2=105, S2=5
and then GOSUB 9000.

