Classic Computer Magazine Archive COMPUTE! ISSUE 32 / JANUARY 1983 / PAGE 71


Dave Sanders, Garland, UT

For TRS-80 Color Computer, Atari and Unexpanded VIC, this game should prove a challenge for all age levels. So far, none of the players who've tried it have been able to get past the second level. But if you do, the game will keep getting harder.

"Thunderbird" will demand your undivided attention and all of the memory the unexpanded VIC-20 has to offer. The object of Thunderbird is to score as high as possible. The high score will be kept from game to game. The scoring is as follows: 200 points for taking out a tree, 50 points for taking out a saucer, 75 points for deflecting off either wing of the Thunderbird, 25 points for deflecting off the main body of the Thunderbird, and 1000 points for breaking out the bottom of the playing field. When the satellite drops into a well, 125 points are subtracted from the score.

You score these points by keeping the satellite in the playing field. The satellite can break out the top and the bottom of the screen. When it breaks out the bottom, you score 1000 points, and a new and more difficult playing field is set up for you. If the satellite breaks out the top of the field, your game is half over. You can lose only two satellites out the top. You prevent the satellite from breaking out the top by deflecting it back into the field with the Thunderbird. The Thunderbird is moved across the top ofjhe field with the cursor control keys.

The display on the right side of the screen tells you if you are playing the first or second satellite. When the satellite drops into a well, the Thunderbird lasers down from one to three multicolored saucers to further hinder the satellite from breaking out the bottom. You will notice that the Thunderbird deflects the satellite one way off its main body and a different way off its wings. You have to keep the Thunderbird moving across the screen in conjunction with the direction the satellite is moving, or you will not play for very long.

With a little practice, the first breakout is not too hard. The second breakout will not be out of reach either, but no one in our neighborhood has broken out the third time. Just in case you are a whiz though, the game will continue to get harder.

Crunching It Into The VIC

Because of the length of the program, I had to use a technique known as "crunching." You can pack more instructions – and power – into your BASIC programs by making each program as short as possible.

Crunching programs lets you squeeze the maximum possible number of instructions into your program. It also helps you reduce the size of programs which might not otherwise run in a given size.

A list of keyword abbreviations is given in the Appendix D in the Personal Computing Guide that you received with your VIC-20. This is helpful when you program because you can actually crowd more information on each line by using these abbreviations. In this program it is mandatory to use this technique on many of the lines when you type them in. The most frequently used abbreviation in this program is PO (P shifted-O) which is the BASIC abbreviation for the POKE command. However, if you LIST a program that has abbreviations, the VIC-20 will automatically print out the listing with the full-length keywords.

If any program line exceeds 88 characters (four lines on the screen) with the keywords unabbreviated, and you want to change it, you will have to re-enter that line with the abbreviations before saving the program.

SAVEing a program incorporates the keywords without inflating any lines because BASIC keywords are tokenized by the VIC-20. Usually, abbreviations are added after a program is written and do not have to be LISTed any more before SAVEing.

REM statements are helpful in reminding yourself – or showing other programmers – what a particular section of a program is doing. However, when the program is completed and ready to use, you probably will not need those REM statements any more; you can save quite a bit of space by removing them. If you plan to revise or study the program structure in the future, it is a good idea to keep a copy on file with the REM statements intact.

Following is a list of REM statements that would have been in my program if there had been room.


Line No. Description
4-17 Routine to set up playing field.
25-26 Subroutine for printing score.
50-54 Routine for making game more difficult.
55-59 Routine for displaying instructions and a short game.
65-80 Routine for firing laser and starting satellite back at a random location.
85 Routine for the graphics when satellite takes out saucers.
90-91 Routine for sounds and points on breakout.
95-98 Routine for sounds and colors on losing satellite out the top of the field.
100-103 Routine for moving Thunderbird across screen.
104-118 This section moves satellite and has all the PEEKs for the other routines in the program.

One of the easiest ways to reduce the size of your program is to eliminate all the spaces. Although programmers often include spaces in sample programs to provide clarity, you actually do not need any spaces in your program and will save memory if you eliminate them.

Instead of PRINTing several cursor commands to position a character on the screen, it is often more economical to use the TAB and SPC instructions to position words or characters on the screen. Well, that's enough on "crunching." You can find these and many other useful instructions in the VIC-20 Programmers Reference Guide VM110 published by Commodore.

On line 68 a couple of saucers are lasered down by the Thunderbird. The screen code POKEd for the saucers is the same as all the other saucers, but they certainly look different. This effect is achieved by POKEing a 9 into the color code location for these saucers. POKEing a color location with a number above eight will switch that location into multicolor mode. You can get some very interesting shapes and colors by using multicolor.

In lines four through seven, the (Q) is the ball graphic, and the (W) is the circle.

Getting ready to play another game of the VIC-20 version of "Thunderbird."

Unleashing a lightning bolt in the Atari version of "Thunderbird."

Making a "wing shot" in the TRS-80 Color Computer version of "Thunderbird."

Atari Notes:

Charles Brannon, Editorial Assistant

Thunderbird for Atari requires a joystick and 16K of memory. You move the bird left and right with your joystick, using it to bounce a ball into a wall of bricks. As in Breakout, the object of the game is to clear out all the bricks, without letting the ball escape past you. A 1,000 point bonus is awarded when you break out the bottom of the wall (a "breakthrough"); and if you're really good, you get 10,000 points for clearing out all the bricks (no mean feat!).

Shades Of Zeus

But the Thunderbird is no mere Breakout paddle! It can unleash the most awesome power of nature — lightning — at the touch of a button (the fire button). Thunderbird will "beam down" several luminous "tiles" that serve to deflect the ball downwards when hit. You can lay down tiles like a cap over a hole the ball has created, to force it to widen the hole. Every time the ball hits a tile, it swoops downward, but 25 points are subtracted from your score. That should discourage overuse of this miraculous feature.

Vertical Blank And IRG 4

Here's a bit of information about the programming. The playing field is a mixed-mode display consisting of two rows of GRAPHICS 1 text, and 21 rows of a multicolored character mode, IRG 4. This lets us have multicolored bricks.

Player/missile graphics are used to represent the bird, which can be any of three sizes, depending on the skill level. The bird is moved left and right by a small machine language routine that is executed every 1/60 second during the TV's vertical blank (when the electron beam is traveling from the lower right-hand corner to the upper left-hand corner of the screen).

IRG mode 4, the multicolor mode, is quite interesting. A single character can be any of three colors. To design these colored characters, divide the character horizontally into four two-bit zones. Each two-bit block controls one pixel of color within the character (a multicolor character's resolution is 4×8). No color would be 00, color one is 01, two 10, and three 11 (simple two-bit binary). For example, one of the bricks consists of several colored bands:


The numbers correspond to a "COLOR" statement. One side and the bottom row are left blank, so the blocks won't touch. The pattern, when expanded into binary, would look like:


Such a "custom character" would look strange on a normal screen (although you would see some semblance of multicolors, due to artifacting). But when displayed on either an IRG 4 or IRG 5 mode screen, each character is like a tiny 4×8 block of GRAPHICS 7 pixels. Also, any character printed in inverse (with the Atari logo key) will look different. The COLOR 3 pixels in such a character will be displayed as COLOR 4 (normally available only in GRAPHICS 1 or 2).

To create an IRG 4 screen, you must replace the bytes for GRAPHICS 0 by modifying the display list. Luckily, the resolution of IRG 4 is identical to GRAPHICS 0, 40×24.

DL = PEEK(560) + 256*PEEK(561) + 4
POKE DL-1, 4 + 64
FOR I = 2 TO 24 : POKE DL + I, 4 : NEXT I

See lines 160-180 of Thunderbird. You can also try out IRG 5, which displays these characters in double-height (40×12).