A.N.A.L.O.G. ISSUE 43 / JUNE 1986 / PAGE 35

Electroids

by James Hague

For years, I’ve been seeing clone after clone of climbing and shooting arcade-style games that show very little originality. After learning assembly language, I believed I could do better. Not realizing the enormity of the task before me, I set out to accomplish what only wizards like Tom Hudson could ever achieve.

After months of errors, bad sectors and everything else my Atari could throw at me my perseverance has been rewarded. The going was rough, but I’m proud to finally present Electroids—an original, 100% machine-language arcade game for one player.

Typing it in.

Listing 1 is the BASIC data used to create both disk and cassette versions of Electroids. Those readers who are interested in how the game works may obtain the assembly listing on either the magazine disk version or the ANALOG Computing TCS.

Disk users should refer to the M/L Editor article on page 81 for typing instructions.

If you have a cassette system, type in Listing 1, then add the lines shown in Listing 2. Type RUN and press RETURN. The program will begin checking the data statements, printing the line niunbers as it goes. It will alert you to any problems. Fix any incorrect lines and rerun the program until all errors are eliminated.

When all your data lines are correct, the computer will beep twice and prompt you to READY CASSETTE AND PRESS RETURN. Now, insert a blank cassette in your recorder, press the RECORD and PLAY buttons simultaneously, and hit RETURN. The message WRITING FILE will appear, and the program will create a machine language boot tape version of Electroids, printing each data line number as it goes. When the READY prompt appears, the game is recorded and ready to play. CSAVE the BASIC program on a separate tape before continuing.

To play the game, rewind the tape created with the BASIC program to the begirming. Turn the computer off and remove all cartridges. Press the PLAY button on your recorder and turn on your computer, while holding down the START key. If you have an XL or XE series computer, you must hold the START and OPTION keys when you turn on the power. The computer will beep once. Hit RETURN, and Electroids will load and run automatically.

The game.

Electroids is a joystick-controlled game for one player. You must protect special “power jewels” from a group of attackers known as Electroids. These creatures fall from the top of the screen, attempting to come in contact with one of the pulsating green jewels at the bottom.

If an Electroid hits one of the many floating yellow platforms, it will move along the surface until it can again continue down. If it does manage to touch one of the power jewels, a short circuit will occur—and you’ll lose five units of energy. On the brighter side, the Electroid which did the damage will be eliminated. You begin the game with fifty units of energy; it’s over when all are lost.

You control a small green creature which defies biological classification. It’s known as simply the “Green Thing.” Its job is to prevent Electroids from short-circuiting those power jewels located in the lower portion of the screen.

The Green Thing is moved left and right along the yellow platforms by pushing the joystick in that direction. If it moves off one side of the screen, it will reappear on the other, and vice versa. If the Green Thing moves off one of the platforms, it will fall, but no harm will come to it (in fact, that’s the only way to move down).

In order to move upward, press and hold the trigger. The Green Thing will jump until the trigger’s release, then it will fall until it hits a platform. It’s important to note that Green Things can be moved left and right while falling and jumping. The Green Thing is quite a versatile little creature, isn’t it?

Now on to the important part. In order to stop an Electroid, you must touch it while it’s green—when it’s falling. This will cause the Electroid to bounce backwards toward the top of the screen until it hits a ledge, when it will again begin the suicidal descent.

This trick will give you anywhere from 5 to 75 points, depending on the level. If you touch an Electroid while he is red (on platforms), energy will be quickly drained from your supply. When I say “quickly,” I mean quickly, so watch out!

The only part of the game that seems to confuse beginners is how to complete a level. A level is complete when a certain number of Electroids have been eliminated.

They can be eliminated in any of three ways: (1) when bounced off the top of the screen, (2) when exiting from the screen through the lower left- or right-hand corners of the screen, or (3) when hitting a jewel.

When a specific number of them have been destroyed, the computer will print LEVEL COMPLETE and automatically advance to the next level. After each level, you’ll get some bonus energy (you’ll need it). There are a total of twelve levels in the game, some of which contain glowing red electrodes. These will drain energy on contact, so be careful!

Electroids is a game which requires much practice to master. It may take a few games to become proficient at controlling the Green Thing, but it’s not that hard. In the early boards, it’s a good idea to just move around at the top of the screen. In later levels, of course, that becomes impossible.

A final note.

Many people have the potential to program some great arcade games, but are convinced it’s for experts only. I’ll admit it’s no piece of cake, but it isn’t impossible, either. Electroids was my first assembly language game and it turned out quite well. Maybe Kyle Peacock could do better, but I’m satisfied with what I’ve accomplished. I encourage others to convert their brainstorms into assembly language mnemonics, because—with a little effort—you never know what could happen. You just might be the next Tom Hudson.


James Hague is a senior at Berkner High School in Richardson, Texas. Although this is the first assembly language program he’s written, it’s not his first published—his Bonk program appeared in issue 35.


Listing 1.
BASIC listing.

1000 DATA 255,255,0,52,13,61,32,101,228,162,0,189,0,224,157,0,4867
1010 DATA 32,189,255,224,157,255,32,232,208,241,169,32,141,244,2,189,2304
1020 DATA 39,52,157,0,32,232,224,48,208,245,76,104,52,0,0,0,2220
1030 DATA 0,0,0,0,0,24,36,66,129,129,66,36,24,255,187,187,5242
1040 DATA 238,238,255,0,0,124,56,124,56,124,56,124,56,0,24,24,9967
1050 DATA 24,24,60,126,255,0,0,0,255,255,255,255,255,72,169,0,649
1060 DATA 141,10,212,141,19,208,141,20,208,141,21,208,104,64,32,245,7568
1070 DATA 54,169,0,133,138,32,93,55,32,75,60,173,10,210,141,22,3278
1080 DATA 208,173,31,208,201,6,240,5,173,132,2,208,238,169,80,133,9503
1090 DATA 134,169,0,133,133,133,132,133,138,133,128,133,129,133,130,141,8866
1100 DATA 30,208,133,185,133,186,133,187,32,93,55,160,132,132,139,169,8989
1110 DATA 115,133,140,141,0,208,162,0,189,146,54,153,0,36,149,172,5939
1120 DATA 200,232,224,12,208,242,162,55,160,120,169,7,32,92,228,169,8981
1130 DATA 0,133,131,133,136,133,137,133,138,133,166,133,135,133,185,133,336
1140 DATA 186,133,187,141,30,208,133,189,133,188,198,139,248,165,133,24,1394
1150 DATA 105,1,133,133,216,166,132,224,12,240,62,232,134,132,189,204,2643
1160 DATA 60,133,165,189,217,60,133,168,169,20,133,170,189,230,60,133,386
1170 DATA 184,189,243,60,133,131,76,51,53,112,112,112,70,0,34,6,781
1180 DATA 6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,1996
1190 DATA 6,6,6,6,6,130,65,19,53,169,19,141,48,2,169,53,770
1200 DATA 141,49,2,169,87,141,0,2,169,52,141,1,2,169,192,141,4550
1210 DATA 14,212,169,26,141,196,2,169,202,141,197,2,169,36,141,198,8909
1220 DATA 2,169,56,141,199,2,162,0,138,157,0,34,157,249,34,232,7402
1230 DATA 224,250,208,245,162,0,189,150,53,133,190,232,189,150,53,133,1052
1240 DATA 191,232,189,150,53,133,142,232,189,150,53,160,0,145,190,200,759
1250 DATA 196,142,208,249,232,224,44,208,221,76,248,53,51,34,6,2,5200
1260 DATA 62,34,3,2,126,34,5,2,174,34,4,2,203,34,5,2,7488
1270 DATA 18,35,3,2,31,35,4,2,85,35,5,2,117,35,5,2,5096
1280 DATA 164,35,20,2,184,35,20,133,153,155,151,147,97,159,101,145,7590
1290 DATA 161,146,160,152,154,133,0,0,0,0,51,35,47,50,37,26,7662
1300 DATA 0,0,0,0,0,0,0,37,46,37,50,39,57,26,0,0,4503
1310 DATA 0,44,37,54,37,44,26,0,0,0,0,0,0,0,169,0,4891
1320 DATA 133,142,166,142,189,194,53,170,169,65,157,0,35,230,142,165,8986
1330 DATA 142,197,184,208,237,162,39,189,208,53,157,204,35,202,16,247,1244
1340 DATA 32,106,58,32,113,58,32,92,58,169,32,141,7,212,169,2,3641
1350 DATA 141,29,208,169,62,141,47,2,32,245,54,169,200,141,192,2,7196
1360 DATA 162,2,32,8,55,202,16,250,169,0,133,187,133,185,133,186,9771
1370 DATA 141,30,208,32,44,55,169,1,133,138,162,8,189,236,54,157,7602
1380 DATA 225,34,202,16,247,160,120,32,15,59,162,8,169,0,157,225,6389
1390 DATA 34,202,16,250,32,34,60,32,68,57,32,120,58,32,149,58,1255
1400 DATA 173,31,208,201,6,208,3,76,135,52,165,165,208,3,76,38,4994
1410 DATA 59,165,134,208,226,76,170,59,124,254,146,146,218,254,124,40,2185
1420 DATA 40,40,108,108,0,124,254,146,146,218,254,124,40,40,108,108,8190
1430 DATA 0,0,124,254,146,146,218,254,124,40,108,108,0,124,254,146,9864
1440 DATA 146,218,254,124,40,40,108,108,0,16,56,124,84,214,254,198,8670
1450 DATA 124,0,24,36,66,129,129,66,36,24,0,24,36,66,66,36,8135
1460 DATA 24,0,0,0,24,36,36,24,0,0,0,24,36,66,66,36,5510
1470 DATA 24,0,103,101,116,64,114,101,97,100,121,169,0,170,157,0,4744
1480 DATA 36,157,0,37,157,0,38,157,0,39,232,208,241,96,173,10,6955
1490 DATA 210,41,127,24,105,65,149,144,157,1,208,173,10,210,41,15,5081
1500 DATA 149,147,169,216,157,193,2,169,1,149,162,149,153,169,0,149,8431
1510 DATA 150,96,164,147,162,0,189,194,54,153,0,37,200,232,224,10,8445
1520 DATA 208,244,164,148,162,0,189,194,54,153,0,38,200,232,224,10,8825
1530 DATA 208,244,164,149,162,0,189,194,54,153,0,39,200,232,224,10,8851
1540 DATA 208,244,96,169,0,141,0,210,141,2,210,141,4,210,141,6,6220
1550 DATA 210,141,1,210,141,3,210,141,5,210,141,7,210,96,165,138,8743
1560 DATA 208,3,76,244,56,169,0,133,77,230,137,166,137,224,3,208,118
1570 DATA 20,162,0,134,137,32,194,58,174,199,2,202,224,48,208,2,7887
1580 DATA 162,60,142,199,2,162,0,189,5,208,41,2,240,27,169,0,4211
1590 DATA 157,1,208,149,150,149,144,165,135,248,24,105,5,216,133,135,9404
1600 DATA 169,138,141,1,210,169,50,133,185,232,224,3,208,217,162,2,639
1610 DATA 189,13,208,41,1,240,34,181,153,201,255,240,28,181,162,208,3472
1620 DATA 16,248,165,135,24,105,1,133,135,216,169,1,133,186,76,243,9595
1630 DATA 55,169,1,149,159,169,16,133,187,202,16,212,173,4,208,41,8111
1640 DATA 8,240,13,248,165,135,24,105,1,216,133,135,169,1,133,186,8236
1650 DATA 166,185,240,32,202,240,14,134,185,142,0,210,173,10,210,141,54
1660 DATA 197,2,76,46,56,162,0,134,185,142,0,210,142,1,210,169,7916
1670 DATA 202,141,197,2,165,186,240,23,169,200,141,3,210,173,10,210,328
1680 DATA 41,3,24,105,43,141,2,210,169,0,133,186,76,79,56,141,5380
1690 DATA 3,210,141,2,210,165,187,240,35,56,233,1,240,22,133,187,9678
1700 DATA 24,105,32,141,5,210,173,10,210,41,15,24,105,60,141,4,2307
1710 DATA 210,76,118,56,133,187,141,4,210,141,5,210,164,139,162,11,8015
1720 DATA 169,0,153,0,36,200,202,16,249,173,120,2,201,11,240,7,7064
1730 DATA 201,7,240,20,76,176,56,166,140,202,224,43,208,2,162,202,555
1740 DATA 134,140,142,0,208,76,176,56,166,140,232,224,203,208,2,162,2063
1750 DATA 44,134,140,142,0,208,165,166,208,9,173,132,2,240,19,169,8605
1760 DATA 0,133,167,32,255,56,165,166,208,3,76,223,56,230,139,76,9412
1770 DATA 223,56,169,1,133,167,165,139,201,30,208,7,169,1,133,166,7893
1780 DATA 76,199,56,198,139,32,223,58,164,139,162,0,181,172,153,0,7830
1790 DATA 36,200,232,224,12,208,245,76,247,56,32,93,55,169,0,141,7037
1800 DATA 30,208,76,98,228,162,0,173,4,208,41,1,208,5,169,1,4266
1810 DATA 133,166,96,165,140,201,137,144,20,189,57,57,197,139,208,5,8328
1820 DATA 169,0,133,166,96,232,224,5,208,239,76,8,57,189,62,57,6955
1830 DATA 197,139,208,3,76,26,57,232,224,6,208,241,76,8,57,37,5535
1840 DATA 85,125,165,189,45,69,101,133,157,189,162,0,181,162,208,8,8790
1850 DATA 169,54,157,193,2,76,87,57,169,216,157,193,2,232,224,3,9307
1860 DATA 208,234,165,169,240,3,198,169,96,165,168,133,169,165,171,240,4533
1870 DATA 3,198,171,96,165,170,133,171,162,0,181,162,208,3,76,154,9053
1880 DATA 57,32,4,58,181,162,208,74,173,10,210,41,1,240,11,169,6871
1890 DATA 0,149,153,169,1,149,150,76,204,57,149,153,169,255,149,150,2163
1900 DATA 32,4,58,181,162,240,43,173,10,210,41,3,240,249,201,1,9087
1910 DATA 240,13,201,2,240,20,169,1,149,153,149,150,76,204,57,169,9011
1920 DATA 1,149,153,169,0,149,150,76,204,57,169,1,149,153,169,255,877
1930 DATA 149,150,232,224,3,208,163,162,0,181,144,24,117,150,201,40,8629
1940 DATA 208,5,169,215,76,231,57,201,216,208,2,169,41,149,144,157,663
1950 DATA 1,208,181,147,24,117,153,201,240,208,5,32,8,55,198,165,8162
1960 DATA 149,147,232,224,3,208,210,76,44,55,160,0,185,40,58,213,7285
1970 DATA 147,208,17,181,144,217,50,58,144,10,217,60,58,176,5,169,6644
1980 DATA 0,149,162,96,200,192,10,208,227,169,1,149,162,96,47,71,7857
1990 DATA 103,135,159,39,87,127,167,191,57,89,65,97,49,129,153,153,7358
2000 DATA 145,41,89,137,113,137,97,185,193,185,193,209,133,142,74,74,817
2010 DATA 74,74,9,16,153,204,35,200,165,142,41,15,9,16,153,204,5593
2020 DATA 35,96,162,2,160,10,181,128,32,70,58,200,202,16,247,96,8009
2030 DATA 165,134,160,24,76,70,58,165,133,160,33,76,70,58,165,135,5994
2040 DATA 208,1,96,165,134,248,56,229,135,216,133,134,201,128,144,4,655
2050 DATA 169,0,133,134,169,0,133,135,76,106,58,162,2,181,159,240,9121
2060 DATA 11,169,0,149,159,169,255,149,153,32,170,58,202,16,238,96,10
2070 DATA 165,131,248,24,101,128,133,128,169,0,101,129,133,129,169,0,6815
2080 DATA 101,130,133,130,216,76,92,58,165,136,24,105,8,201,32,208,7099
2090 DATA 2,169,0,133,136,168,162,0,185,204,54,157,8,32,200,232,9231
2100 DATA 224,8,208,244,96,165,166,208,43,165,167,208,39,230,189,165,3808
2110 DATA 189,201,7,208,31,169,0,133,189,165,188,24,105,12,201,48,6810
2120 DATA 208,2,169,0,133,188,168,162,0,185,146,54,149,172,200,232,2265
2130 DATA 224,12,208,245,96,169,0,133,20,132,142,165,20,197,142,240,570
2140 DATA 10,173,31,208,201,6,208,243,76,135,52,96,32,93,55,169,6867
2150 DATA 0,141,1,208,141,2,208,141,3,208,162,13,189,254,59,157,23
2160 DATA 223,34,202,16,247,160,10,169,168,141,1,210,169,105,141,0,7973
2170 DATA 210,169,134,141,196,2,32,15,59,169,115,141,0,210,169,26,6089
2180 DATA 141,196,2,32,15,59,165,134,240,70,136,208,223,32,93,55,7977
2190 DATA 162,13,189,12,60,157,223,34,202,16,247,166,132,189,0,61,8093
2200 DATA 170,165,134,201,117,240,10,248,24,105,1,216,133,134,32,106,7635
2210 DATA 58,160,8,169,40,141,1,210,140,0,210,132,143,160,1,32,5801
2220 DATA 15,59,164,143,136,16,241,202,208,215,32,93,55,76,201,52,8612
2230 DATA 169,0,133,138,141,0,208,141,192,2,32,93,55,169,202,141,8222
2240 DATA 197,2,169,24,133,136,32,194,58,162,0,189,26,60,157,226,7860
2250 DATA 34,160,25,32,15,59,232,224,8,208,240,160,120,32,15,59,6541
2260 DATA 169,15,133,168,133,170,133,165,32,68,57,173,31,208,201,6,7563
2270 DATA 208,3,76,135,52,173,132,2,208,3,76,135,52,165,165,208,8637
2280 DATA 231,76,104,52,108,101,118,101,108,64,99,111,109,112,108,101,6217
2290 DATA 116,101,64,98,111,110,117,115,64,101,110,101,114,103,121,64,5917
2300 DATA 116,104,101,64,64,101,110,100,165,132,201,3,144,34,169,195,8734
2310 DATA 141,11,34,141,31,34,165,132,201,7,144,20,169,195,141,7,6566
2320 DATA 34,141,27,34,141,47,34,141,67,34,141,87,34,141,107,34,3309
2330 DATA 96,169,102,141,197,2,169,150,141,198,2,169,200,141,199,2,9904
2340 DATA 169,101,141,48,2,169,60,141,49,2,96,112,112,112,112,112,5255
2350 DATA 112,112,112,112,112,112,71,124,60,112,6,6,112,112,6,65,2143
2360 DATA 101,60,0,0,0,52,40,37,0,37,44,37,35,52,50,47,7452
2370 DATA 41,36,51,0,0,0,64,64,64,64,64,64,72,99,73,64,725
2380 DATA 81,89,88,84,64,0,0,0,0,0,128,128,128,162,185,128,5258
2390 DATA 170,161,173,165,179,128,168,161,167,181,165,128,128,128,192,192,4260
2400 DATA 192,192,240,242,229,243,243,192,192,243,244,225,242,244,192,192,2560
2410 DATA 192,192,0,5,7,9,10,11,12,12,12,12,12,12,12,0,4261
2420 DATA 18,15,12,10,9,8,7,6,5,4,3,2,0,1,3,4,2999
2430 DATA 5,6,7,8,9,10,11,12,14,0,5,16,21,32,37,48,5195
2440 DATA 53,64,69,80,96,117,0,5,5,5,7,7,7,10,10,10,5167
2450 DATA 15,15,15,0,224,2,225,2,0,52,0,0,0,0,0,0,5783

Listing 2.
BASIC listing.

10 REM *** ELECTROIDS ***
20 REM CASSETTE MAKER PROGRAM
40 DIM DAT(16):LINE=990:RESTORE 1000:TRAP 120:? "CHECKING DATA"
50 LINE=LINE+10:? "LINE:";LINE:FOR X=1 TO 16:READ DAT:IF DAT<8 OR DAT>255 THEN 220
60 DAT(X}=DAT:NEXT X:DATLIN=PEEK(183)+PEEK(184)*256:IF DATLIN<>LINE THEN ? "LINE ";LINE;" MISSING!":END
70 TOTAL=LINE:FOR X=1 TO 16
80 IF PASS=2 THEN PUT #1,DAT(X):NEXT X:READ CHKSUM:GOTO 50
90 TOTAL=TOTAL+DAT(X)*X:IF TOTAL>9999 THEN TOTAL=TOTAL−10000
100 NEXT X:READ CHKSUM:IF TOTAL=CHKSUM THEN 50
110 GOTO 220
120 IF PEEK(195)<>6 THEN 22
130 IF PASS=0 THEN 200
160 FOR X=1 TO 128; PUT #1,0:NEXT X:CLOSE #1:END
200 ? "READY CASSETTE AND PRESS RETURN";:OPEN #1,8,128,"C:":RESTORE 230:FOR X=1 TO 40:READ N:PUT #1,N:NEXT X
210 ? :? "WRITING FILE":PASS=2:LINE=990:RESTORE 1000:TRAP 120:GOTO 50
220 ? "BAD DATA: LINE ";LINE:END
230 DATA 0,19,210,51,249,51,169,0,234,234,234,169,60,141,2,211,169,0,141,231,2,133,14,169,56,141,232,2
240 DATA 133,15,169,0,133,10,169,52,133,11,24,96

Listing 3.
Assembly listing.

Missing