![]() |
STARS by Paul Lay |
|
If you want to write a good space game you need a good background and what better than a scrolling starfield such as used in STAR RAIDERS or GALAXIAN? The programs presented here give you various starfields to which you can add your own game play. Listing 1 is a simple scrolling star field which uses one missile and a Display List Interrupt service routine to provide an excellent set of scrolling stars which are independent of the playfield. The routine is shorter than it looks as lines 160 - 290 are merely a demo to illustrate how printing to the screen does not affect the stars. Listing 2 is a better version that uses a much more complex Display List Interrupt to give a 3-D effect Lines 10 - 440 provide the basic routine with the remainder of the program giving a demonstration to show the independence of the stars from the playfield. A further demonstration of the use of this routine is given in Listing 3. This includes some machine code routines to allow you to steer through the stars by using a joystick in port 1. To run this one delete lines 450 - 570 from Listing 2 and add the new lines. Finally for those of you interested in exploring the routines further I have included the assembler source code for the display list interrupt. |
|