ALIEN SHOWDOWN by (unknown) from Games Computing, February 1984 Play at cowboys in space with this great guns game to play on a Spectrum or any other machine come to think of it. It's you or the alien enemy who must fight for survival in this galactic gun-down for two players to get to grips with. Each player has three lives to tussle with and each operate one space cowboy positioned on either side of the screen. You can both move your spaceman up and down the screen, aiming your gun-slinging arm at the enemy and avoiding his deadly shots. If you manage to shoot down the enemy space cowboy a rocket flies past and you'll know for sure if you have only one life to play because the screen will suddenly start flashing violently. When I wrote this game I found the main problem was to maintain a smooth flow of on-screen action. So I had to make sure the spaceman, rocket and firing was programmed on a pixel by pixel basis. To make the action happen quickly I had to use machine code instead of BASIC. Control your space cowboys by using the following keys: Player A: (left-hand side) Any key in row 1 to 5 will fire Any key from Q to T moves UP Any key from A to G moves DOWN Player B: (right-hand side) Any key in row 6 to 0 will fire Any key from Y to P moves UP Any key from H to ENTER moves DOWN The program is entered in three parts: the machine code, the graphics and the BASIC. Enter Program One first of all. This is the machine code program and SAVE both Program One and the machine code. After checking to RUN the machine code type PRINT USR 31000. If it does not work, re-check that you have keyed in Program One correctly. Now enter Program Two, which contains the graphics of the game. SAVE both the graphics and program if you wish. You could try making your own graphics to suit your own particular tastes, in which case look at the section I've launched here under Conversion Clues. RUNdown Notes in the assembly listing [Not printed in the magazine. JimG] shows how the machine code runs. It is fairly simple. The main routine reads the keyboard, calling the routines as required. It also detects whether the player has run out of lives, or whether or not the rocket should be moved. The most important note is the ROM routine, called at 8874. B is loaded with the Y co-ordinate, C with the X co-ordinate and the routine called. The result is that HL contains the screen address, and the accumulator (A) with the number of the bit (0-7) corresponding to the pixel. For those who are interested in games programming, if B is loaded with the Y co-ordinate and 8933 called the point is plotted and the HL register contains the address of the ATTRIBUTE and DE is the value of the attribute. Program 1. This POKEs the machine code into the correct memory locations. Program 2. Sets up the graphics by the same method as Program 1. Program 3. Line 10 Loads the machine code and graphics. Lines 20-50 Instructions and input. The speed of the phaser is determined by the length of the sound. The length of the sound is the value POKEd to 31516. Line 100 and the subroutine at 200 creates the alien-type scenery, in random blocks with random characters. Line 110 Calls the machine code. Lines 120-130 Detects to see who has won. Line 140 Gives you the option of having another go. Line 9999 SAVE routine. Conversion Clues This program is written specifically for the Spectrum. The use of machine code makes it difficult to convert, but the assembly listing should help. Alien Showdown was written on the 16K Spectrum but it also works on the 48K machine. If you want to make up your own graphics remember that they must be upside down and on a 48K Spectrum you must POKE 23675,88 and POKE 23676,127. Also note that the highest and lowest lines of the graphics have to be 0 in order to blank out an old position. SPUCKMAN by A. Weekes from Games Computing, February 1984 Spuckman is a version of the ever popular arcade game for the 16K or 48K Spectrum. There are two extremely intelligent Ghosts, so you will need the four Power Pills and five lives you are given. The Ghosts are red when dangerous and green when safe, and are Graphic 'A's. The Muncher can face either left or right, and so is defined onto the keys 'B' and 'C'. The main problem encountered when writing the program was preventing the Ghosts getting trapped in dead ends and corners of the maze, and this problem was only overcome by redesigning the layout with a minimum of these restricting positions present. The game is far from easy, but the Ghosts can be slightly disabled by adding a random element to the movement logic in lines 105 to 155. Keys T, V, F and G are used for movement, but these can be altered as desired in line 90. Warning! SAVE and VERIFY the program before running! Here is a general breakdown of the listing. RUNdown Lines Action 1 protects listing from erasure 10 & 20 increment score 30 GOSUB sets up variables and maze 40 & 60 move characters 50 calculate which way the Muncher is facing 70-90 calculate new position of Muncher 100-155 Boolean algebra for movement of the Ghosts 160-220 check for eating of power pill, capture, exit/entrance, etc. 230 & 240 loss of a life / end of game 250-310 draw maze and set up variables Variable Use P direction of Muncher P$ appearance of Muncher (depends on P) A$ used for reading keyboard S & SC scoring variables X,Y&X1,Y1 co-ordinates of Ghost 1 M,N&M1,N1 co-ordinates of Ghost 2 A,B&A1,B1 co-ordinates of Muncher S$(22,31) stores all wafers [sic] in an array PP Power Pill state (1=on, 0=off) F & C utility variables Conversion Clues Most of the functions used can be easily converted to an equivalent function. Function Equivalent INKEY$ GET or GET$ ATTR POINT or LOCATE PRINT AT POSITION or PRINT TAB or PRINT @ BEEP SOUND (or can be omitted) BORDER/ PAPER/INK can be omitted or changed FLASH can be omitted BRIGHT Some way must be found of making the maze a different colour or intensity from the rest of the display so that it can be detected by ATTR (or equivalent) in lines 90, 100, 120 & 300. UDGs Can be omitted or converted, as methods of defining vary considerably. Otherwise I suggest inverse quotes for Ghosts and > & < (greater than / smaller than signs) for the Muncher. POKE The POKE in line 1 is just to protect the program against erasure, and can be omitted.