WHITE LIGHTNING - SECTION 1 THE SPRITE GENERATOR PROGRAM by Paul Newnham INTRODUCTION The Sprite Generator Program was developed to compliment the White Lightning language. The language is comprised of commands for manipulating sprites and screen data but does not have the facility to directly design graphics characters. This means there are two phases to games creation. The first involves designing and editing your graphics characters with the sprite generator program, and the second involves the writing of the game itself using the White Lightning language. In practice the two areas of work will probably be carried out simultaneously. For those of you who are not artistically inclined, there are two sets of previously defined graphics characters ready to use. The Arcade Character Set The arcade character set is an integral part of the sprite generator program - 167 characters are provided in all. To see these, LOAD and run DEMO B using LOAD "". The demo will auto-run. This will tell you which characters can be called up by which number, using Function Key Z. These characters are summarised as the penultimate part of this section. The Demonstration Sprites Directly after White Lightning on side A you will find the demonstration sprites. By running the tape past White Lightning and using the LOAD SPRITES FROM TAPE facility, these can be loaded and edited for your own use. The various sprites are tabulated at the end of this section. USING SPRITES WITH WHITE LIGHTNING Once you have completed an editing session, the sprites generated should be saved to tape for further editing sessions, or for use with the White Lightning language itself. To load your sprites into White Lightning: 1. Load White Lightning using LOAD "" 2. Insert the tap containing your sprites into the tape recorder and press Y in response to the "LOAD SPRITES Y/N" prompt. The sprites will be loaded at the address from which they were saved using the sprite generator program. COLD START If you enter the sprite generator program via a COLD start, then all sprites previously stored will be cleared and all system variables reset. If, for instance, you wish to use the demonstration sprites, you would enter via a COLD start. The program must always be initially entered via a COLD start. WARM START If you enter the program via a WARM start then all the sprites will be conserved and all system variables are left unchanged. It is provided principally for re-entering the program after an accidental BREAK or ERROR. If you do accidentally BREAK; type GOTO 3 and then enter via the WARM start. BUFFER SIZE When White Lightning runs programs in background mode (see Section 3) the top end of memory is used as a scratch pad. The size of this area depends on the operation of the program and calculating the amount you need to reserve is covered in Section 3. When the sprite generator program is entered the buffer has a default size of 256 bytes. This is probably much larger than required, but until you are familiar with the package or need to save a few extra bytes, just leave the buffer at 256 bytes. THE CHR$ SQR CHR$ SQR is the abbreviation used throughout this text for character square, and refers to the 8x8 grid to the left of the sprite screen. This is the area used to create and edit sprites one character at a time. THE SPRITE SCREEN This is the area of screen 15x15 characters on which sprites are created, developed, transformed and generally worked on. THE CHR$ SQR CURSOR This is the non-destructive flashing cursor which is used to design and edit the character currently held in the CHR$ SQR. THE SPRITE SCREEN CURSORS These are the two flashing cursors displayed in the row beneath the sprite screen and the column to the right of the sprite screen. They are used to indicate the position of the top left-hand corner of the screen window currently being operated upon. The actual cursor positions are measured from the top left-hand corner of the sprite screen and are displayed in real time on the screen as X POS (column) and Y POS (row). Top left is X POS 1 Y POS 1. Bottom right is X POS F Y POS F. SCREEN WINDOWS The area of the screen currently being worked on is referred to as the screen window. Its position is defined by X POS and Y POS, which correspond to the positions of the sprite screen cursors; and its dimensions are defined by SPRITE HEIGHT and SPRITE LENGTH. To see the screen window you are currently working on just press F; the window will flash. SPRITE LIBRARY This refers to the set of sprites you are currently working with and can contain up to 255 sprites or use 12,500 bytes. If your sprite library needs more than 12,500 bytes you can use the merging procedure detailed in Section 3 to load and merge more than one sprite library into White Lightning. OPERATING INSTRUCTIONS Insert the Sprite Generator Program tape, type LOAD "" and load into the computer as normal. Once loaded the program will auto-run and the screen message "COLD OR WARM START" will appear. If this is the first execution of the program or if you wish to clear the sprite memory, press C for COLD START. A further screen message will now appear asking if you wish to change the buffer size - this has a default value of 256 bytes. For now, press N. This function will become more apparent later. [...] FUNCTION KEY SUMMARY [this is a more concise version than that printed in the manual] A Attribute switch 1 = on (take selected sprite attributes); 0 = off (ignore selected sprite attributes) B Bright variable 1 = on, 0 = off C Paper variable 0 - 7 D Direct Data Input Accepts 8 bytes of data, one byte at a time followed by ENTER, to the current Sprite Screen position. E Screen Function There are three options: 1 = Invert; 2 = Mirror; 3 = Mirror Attributes F Flash Window Flashes the current Sprite Screen window position. G Get Sprite function Gets the current sprite and stores it in memory. H Sprite Height variable Input the height of sprite window: 1-15. I Attribute Dump function Places the current attributes to the current Sprite Screen position. J Move CHR$ SQR to Sprite Screen function Dumps the CHR$ SQR bit pattern to the current Sprite Screen position. K Move Sprite Screen to CHR$ SQR function Dumps the bit pattern from the character square at the current Sprite Screen position to the CHR$ SQR. L Sprite Length variable Input the length of sprite window: 1-15. M Sprite functions There are three options: 1 = Invert; 2 = Mirror; 3 = Mirror Attributes These act on the sprite in memory, rather than on the screen (E). N No - negative response to questions O Sprite Logic functions There are three options, each of which GETs an area of the Sprite Screen from the current Sprite Screen position of the size of the current sprite and GETs the data into the current sprite: 1 = GETORS; ORs the screen data with the pre-defined sprite 2 = GETXRS; XORs the screen data with the pre-defined sprite 3 = GETNDS; ANDs the screen data with the pre-defined sprite P Put functions There are four options, each of which PUTs the current sprite into the current Sprite Screen position: 1 = PUTBLS; a straightforward replacement 2 = PUTORS; ORs the sprite data with the screen data 3 = PUTXRS; XORs the sprite data with the screen data 4 = PUTNDS; ANDs the sprite data with the screen data Q Clear CHR$ SQR function R Rotate Sprite function Rotates a sprite in memory by 90 degrees. S Sprite Number variable Asks for a sprite number: 1-255 T Test Sprite function Sets variables for the current sprite: Sprite Height, Sprite Length, Sprite, SPST, SPND, Memory Left U Pick Up Attributes function Picks up the attributes from the current Sprite Screen position and applies them to the current attribute variables. V Flash variable 1 = on, 0 = off W Wipe Sprite function Erases the current sprite and moves up lower sprites in memory. X Ink variable 0 - 7 Y Yes - positive response to questions Z Pre-defined Arcade Character function Place a pre-defined Arcade Character to the current Sprite Screen position: 1-167 5 Move CHR$ SQR 1 place left 6 Move CHR$ SQR 1 place down 7 Move CHR$ SQR 1 place up 8 Move CHR$ SQR 1 place right 9 Set CHR$ SQR at current position 0 Clear CHR$ SQR at current position BREAK + SPACE Place Sprite into Sprite Window function Places a smaller sprite into a larger one at position ROW,COL in memory. There are four options: 1 = GETBLS; GETs the smaller sprite data into the larger sprite window 2 = GETORS; ORs the smaller sprite data into the larger sprite window 3 = GETXRS; XORs the smaller sprite data into the larger sprite window 4 = GETNDS; ANDs the smaller sprite data into the larger sprite window SYMBOL SHIFT + J Load Sprites from Tape facility Q Clear Sprite Screen function R Relocate Sprites function S Save Sprites to Tape facility 5 Move Sprite Screen Cursor 1 place left 6 Move Sprite Screen Cursor 1 place down 7 Move Sprite Screen Cursor 1 place up 8 Move Sprite Screen Cursor 1 place right WHITE LIGHTNING ARCADE GRAPHICS LIBRARY CHARACTER DESCRIPTION 1- 8 Asteroids space ships 9- 11 Asteroids 12 Asteroids flying saucer 13- 20 Pac-Man 21- 22 Pac-Man ghosts 23- 25 Pac-Man fruit 26- 33 Pac-Man maze parts 34- 44 Assault Course-type games 45- 54 Defender-type games 55- 62 Defender-type landscapes 63- 67 Space Invaders 68- 70 Space Invaders bases 71- 74 Space Invaders guns, etc 75- 84 City Bomber-type games 85- 88 Lunar Lander-type games 89- 98 Frogger-type games 99-107 Centipede-type games 108-117 War-type games 118-130 Donkey Kong-type games 131-136 Space War-type games 137-141 explosions 142-148 bug-eyed monsters 149-152 robots 153-158 Adventure-type games treasure 159-167 zaps WHITE LIGHTNING DEMONSTRATION SPRITE LIBRARY SPRITE DESCRIPTION INK PAPER LENGTH HEIGHT 1 vintage car 4 0 4 2 2 van 5 0 4 2 3 dragster 6 0 4 2 4 duck 6 0 3 3 5 dancer 7 0 2 4 6 rocket 5 0 4 2 7 spider #1 5 0 4 5 8 spider #2 5 0 4 5 9 top of train 4 0 11 2 10 railway track 6 0 8 1 11 small wall 1,5 7 4 1 12 Oasis logo 5,7 0 12 4 13 T.V. 2 0 15 12 14 top of railway coach 5 0 10 2 15 space ship 0 5 4 2 16 shadow of space ship 5 7 4 1 17 large wall 2,7 7 8 2 18 train wheels #1 4,7 0 11 1 19 train wheels #2 4,7 0 11 1 20 train wheels #3 4,7 0 11 1 21 train wheels #4 4,7 0 11 1 22 railway coach #1 7 0 10 1 23 railway coach #2 7 0 10 1 24 Invader 0 degrees 6 0 2 2 25 Invader 90 degrees 6 0 2 2 26 Invader 180 degrees 6 0 2 2 27 Invader 270 degrees 6 0 2 2 28 face with hat #1 4 0 4 3 29 face with hat #2 4 0 4 3 30 'WHITE' 5,7 0 7 2 31 'LIGHTNING' 5,7 0 10 2 32 lightning bolt 5 0 13 4 33 crab 4,7 0 5 3 34 lunar lander 7 0 6 4 35 radar #1 7 0 2 1 36 radar #2 7 0 2 1 37 radar #3 7 0 2 1 38 radar #4 7 0 2 1 39 radar #5 7 0 2 1 40 radar #6 7 0 2 1 41 radar #7 7 0 2 1 42 radar #8 7 0 2 1 43 explosion 7 0 2 2 44 lunar surface 6 0 15 1 45 rotating ball #1 6 0 4 4 46 rotating ball #2 6 0 4 4 47 rotating ball #3 6 0 4 4 48 rotating ball #4 6 0 4 4 49 clockwork toys #1 4 0 3 12 50 clockwork toys #2 4 0 3 12 59 'TRY THIS' 4 0 8 1 60 'WITHOUT' 4 0 8 1 61 'FROM' 5 0 5 1 251 bouncing ball #1 0 6 3 3 252 bouncing ball #2 0 6 3 3 253 bouncing ball #3 0 6 3 3 254 bouncing ball #4 0 6 3 3 -- end of Section 1