Classic Computer Magazine Archive COMPUTE! ISSUE 52 / SEPTEMBER 1984 / PAGE 91

Lightsaver

Jon Rhees

The world is depending on you to save its supply of light bulbs. A quick eye and an even faster hand are the only two things that will help you. This arcade-style action game uses machine language for fast action. Versions are included for the Commodore 64 and VIC-20, the Atari home computers, and the IBM PC/PCjr.

Technology has backfired again! A dangerous power surge has transformed the light fixture in your room into a devilish lamp, which is trying to rid the world of light bulbs by tossing them to the ground. Only you can stop the lamp from carrying out its horrid plan. You must catch the bulbs in your baskets before they hit the ground and break. The more bulbs you save, the more angry the lamp will become, and the faster it will drop bulbs. How long can you survive the wrath of the lamp?

"Lightsaver" is a fast-action, arcade-style game which utilizes many of the capabilities of the Commodore 64. Most of the action in this game is written in machine language for speed, while the scoring and setup routines are written in BASIC. The game requires a set of paddle controllers, which should be plugged into port 1.

The object of the game is simple: catch as many light bulbs as you can without missing or dropping any. You must catch each bulb in your baskets. At the beginning of a game you start out with three baskets, stacked atop each other. You position the baskets by turning the paddle controller. Each time you miss a bulb, you lose a basket, and are set back one level. Each consecutive level has more bulbs to catch and faster action. Bonus baskets are awarded every 2000 points, but you can have only three baskets at a time. Also, the higher the level you are on, the more points each bulb you catch is worth.

There are 16 skill levels in Lightsaver and two basket sizes. The higher the skill level you choose, the faster the game. Bulbs are easier to catch with a large basket than with a small one. A large basket is twice as wide as a small one. You can change the basket size during the game by pressing the f1 key. Press the paddle fire button to start a new round.

Lightsaver takes advantage of the sprite, redefined character, color, and sound capabilities of the 64. It contains two separate machine language routines—one for the game action, and another to quickly copy the character ROM into RAM for programmable characters. A demo mode is also included. The computer plays a game against itself if left alone. All eight sprites are used, as well as a redefined character set. The first two voices of the SID (Sound Interface Device) chip are used for sound effects, and the third voice is used as a random number generator for the machine language routine.

If you'd rather not type in the program, you can obtain tape or disk copies (64 version only). Send an SASE, a disk or tape, and $3 to:

Jon Rhees
1660 S. Duneville
Las Vegas, NV 89102

Notes For VIC-20, Atari, And IBM PC/PCjr Versions

In "Lightsaver," you must catch light bulbs that fall from a lamp at the top of the screen.

The VIC Version

Program 2, for the unexpanded VIC-20, is written entirely in machine language and offers five levels of play. The level selected affects the speed of the falling bulbs at the beginning of play. The speed increases when a light bulb is caught in your basket and decreases when light bulbs crash to the bottom of the screen. The game ends when three bulbs have been missed.

You move your baskets under the falling bulbs by using a paddle plugged into the control port.

Since the VIC version is written in machine language, you must use a special technique to enter the program. You must first type in the "Tiny MLX" program found elsewhere in this issue, and then use this program to type VIC Lightsaver. Be sure you read and understand the Tiny MLX article before you begin typing Lightsaver. Also, remove or disable any memory expanders. Once you have typed in Lightsaver, and saved it to tape or disk using MLX, you can load and run the program just as you would a BASIC program.

The Atari Version

To catch bulbs in the Atari version of Lightsaver, you must move your basket with the paddle controller and touch the bulbs before they hit the bottom of the screen. If a light bulb reaches the bottom of the screen, it will break and you will lose one of your three baskets. The number of points awarded for catching a bulb is equal to the current level. For instance, on the fourth level, every bulb that you catch is worth four points. You are given an additional basket every 2000 points. Each time you complete five levels, the speed of the light bulbs increases.

Atari Lightsaver has been split into two programs so it will work on 16K computers with DOS. Load and run Program 3. This program loads two machine language subroutines and the redefined character set. When finished, this program will load and run Program 4. Program 4 (the main program) contains the player missile graphics and the main game loop. Since Program 3 loads and runs Program 4, disk users must save both programs on the same disk. Program 4 must be saved with filename LIGHTSAVER.

Cassette users must change line 1046 in Program 3 to:

1046 READ A: IF A = -1 THEN PRINT "HIT RETURN TO LOAD LIGHTSAVER": RUN "C"

Next, rewind a tape to a blank section, press the PLAY and RECORD buttons, and enter SAVE "C:" to store Program 3. When the cassette is finished, type in Program 4. Save Program 4 immediately following Program 3 by once again entering SAVE "C:". To load and run the two programs, rewind the tape to the start of Program 3 and type RUN "C:".

The IBM Version

In the IBM version of Lightsaver (Program 5), you must catch bulbs before they fall below basket level. The IBM version has only one difficulty level and a constant basket size. Game play consists of several rounds, each consisting of a barrage of dropping bulbs. Between 10 and 20 bulbs are dropped before the round ends. Each additional round increases the motion of the lamp which drops the bulbs and increases the number of points awarded. The formula is simple: The number of points awarded equals the number of bulbs caught, multiplied by the difficulty level.

You can catch a bulb only if it drops into the basket from above. It is possible to break a bulb by hitting it with the rim of your basket. If you let a bulb break, the round ends and the difficulty level decreases by one.

IBM Lightsaver will run on PCs with Advanced BASIC (BASICA) and PCjrs with DOS and Cartridge BASIC. A Color/Graphics Monitor Adapter card is needed on PCs. A joystick is required to control the left-right movement of the baskets.

Since the video display processor of the IBM PC may refresh the screen while we are using the PUT statement to place graphics on the screen, a short machine language routine has been included to synchronize PUT with the vertical retrace interval.

            MOV DX,3DAh
CHECKPORT   IN AX,DX
            AND AX,8
JZ CHECKPORT
RETF

This machine language routine reduces flicker when the baskets are moved around the screen.

The player just missed a light bulb in the 64 version of "Lightsaver."