Laser Barrage
Sean Igo
Ogden, Utah
Defend your energy pods against the fifteen amok robots. For Atari and PET/CBM.
Here is a one-player game for 40-column PETs. It is packed with action and fun. [To run it on the 80-column machines, use the program on pg. 130 of COMPUTE! #12 — Ed.]
The Idea
In this game, 15 enemy robots are after some fuel pods of yours. You must defend the ten pods. The robots must touch a pod to eat it, but you may zap robots with a laser.
All the robots pick a pod to pursue. They will flatten anything in their way (except each other) to get it. This includes the barriers that are scattered about (which you will bounce off).
When a robot destroys a pod, whether or not it was his objective pod, he will pick a new one to go after.
Figure 1 A sample playfield. Robots are Diamonds, Barriers are Grids, Fuel Pods are Circles, and the Player is the V.Laser Barrage has eight main routines, and all are noted in the program by a REM statement.
Set Up Playfield – draws playfield, initializes variables, places pods, robots, barriers, and player, defines functions.
Move Player – increments the position of the player and scans the upcoming space in the event that the player is moving.
Fire Player – shoots the player's laser. The laser spans five spaces and will destroy pods as well as robots. Watch where you shoot! The ray will not destroy barriers.
Move Robots – moves one robot one space toward its target pod. The player and robots alternate moving, so the game goes a lot faster than if the player waited for all the robots to move.
Rotate Player – rotates player clockwise, counterclockwise, or 180°.
You Win You Lose – deliver a message of appropriate nature.
Instructions – instructions preceded by a small graphic laser effect.
Tips For Playing
When the game starts, it is OK to patrol around and blast robots at your leisure. But when the game winds down to the last few robots or pods, it is wise to guard a single pod or a small group of them and attack robots approaching. If you can keep your laser between them and their target pods, you will do better. Even if you save only one pod from destruction, that is better than losing.
When patrolling around, you must remember these guidelines. When in doubt, STOP. Don't run into a robot because that causes instant destruction. Running into pods is alright because that only stops you. Barriers are treacherous, for you will bounce off them, possibly into a robot.
Atari Notes
Charles Brannon
Editorial Assistant
The Atari version of Laser Barrage requires 16K and a joystick. When you RUN the program for the first time, you'll see the message "PLEASE WAIT", and if you turn up your TV volume control, you'll hear a series of random tones as the custom character set for the game is initialized.
Subsequent RUNs will not require the initialization, thanks to line 1080, which checks it the character set is already POKEd in. This technique is very useful if a program will be RUN many times at one sitting. It can be used with machine language programs to PEEK a certain location to see if a particular opcode is present. If not, a READ/POKE loop can be called to put the machine language code into memory.
Go After The Amok Robots With Z-Beams
You start the game with three ships. The screen is filled with "energy pods," blue robots, and brick-like obstacles. Each robot picks a pod to attack, and then moves towards it with deadly deliberation. If a robot contacts a pod, the pod bursts and collapses, and the robot instantly picks another target to destroy.
Your ship, which can be controlled in eight directions with the joystick, can fire a powerful "Z-beam" in whatever direction it is currently facing. Your mission is to clear the screen of robots by destroying each one with your Z-beam. You get one point for each robot you eliminate, and when you clear the screen, five points for each surviving pod.
You then face a new screen of pods and robots, but each new level challenges you with two additional robots. You know you're really good (but in big trouble) when you have 15 or more robots to deal with. The game can handle up to 64 robots, but it is inconceivable that anyone could withstand the "Laser Barrage" that long. (But if you're superhuman and manage to, you can change lines 1640 and 1650, memory permitting.)
A Speedy Technique
One interesting thing about this game is its fast, execution speed, a feat normally impossible in BASIC. Character graphics (with a custom character set) allows you to create detailed, colorful games, but you are limited (without using special techniques, such as fine scrolling) to a single character of resolution. This makes motion seem rather coarse compared to player/missile graphics.
Nevertheless, character graphics in modes one and two provides a great deal of flexibility. Unlike player/missile graphics, a single POKE to "screen RAM" determines the X, Y position of a character. PEEK can be used like LOCATE to check for collisions. This simplicity allows you to program games in BASIC that will run pretty fast.
One last note on the importance of positioning BASIC subroutines to maximize speed. Laser Barrage has a large section of "initialization" code, which is run only once at the beginning of the program. When all this code was moved to the end of the program, the game ran twice as fast!
Lasser Barrage – Atari Version