
I wrote this game back in 1983. I would have been about 15 years old, so pardon my juvenile humor with the phonetic spelling of asteroid. My high school buddy, Patrick, did the graphics. It is kind of a miracle I still have the code. It spent about 14 years on an old cassette tape in the closet. (long since lost) It then spent another 12 years in PC-VIC's 'PCV' format. I've since resurrected it in D64 format for use on the VICE Emulator or a real VIC-20 (what is motivating me now).
It is an Arcade/Avoid genre game in the style of a downhill skier or cavern runner. Use your joystick to fly through an asteroid field at warp speed. The longer you stay alive the higher your score. Arcade fun for the whole family! assteroyd_dodger.d64 To the right is how I might have imagined the tape inlay for a "published" game. (strongly influenced by Atari Asteroids)
Update November 8, 2010 - A few things have been bugging me about the code so I made some minor changes. Tightened up the main loop. Stripped out some POKEs to help the running time. Added comments. Etc... What a slow and sloppy piece of junk! lol
Update November 9, 2010 - The crash and rescue scenes were still bothering me. I made some additional changes to do now what I should have done then in '83. I don't think I can squeeze any more performance out of the main loop without switching to ML. (This thing will scoot as-is though.) A new goal since yesterday: I wanted to get the final size of the code down below 1K and it is 985 BASIC BYTES only!
Update November 10, 2010 - Announcing a special edition of the game with CB2 sound (see Programmer's Reference Guide, pg. 232) and Protovision 4-Player Interface support (outer-most joystick port). This is the fastest version yet because reading the Protovision joystick requires two fewer steps than the default port on the VIC-20.
Update November 11, 2010 - My friends at Denial VIC-20 Community suggested that I not use large constants in my main loop because, for example, when BASIC parses something like 37152, it internally constructs the value like this: (((3*10+7)*10+1)*10+5)*10+2. If I put the value into a variable, that overhead is avoided. And variable access is quicker for those variables assigned to earlier during execution, as BASIC always scans the whole list of variables from the beginning while matching for a variable name. I've kept that in mind for variables used in the main loop (6-9), and made those updates to the code. Code size has grown to 1016 Bytes for the "CR" version and 1006 Bytes for the "CB2" version. So, the "CB2" version is the winner with respect to size and running time.
Update November 12, 2010 - I realized today that I could get multi-color graphics for free, so I added that to the "CB2" version also. The asteroids look less like potatos now and more like piles of rubble.
Update November 13, 2010 - Fixed an issue with the loader and VICE Emulator. I can't get the CB2 sound working in the VICE Emulator, and you have to set the Settings -> Userport joystick settings... to "PET userport joy adapter" and have something specified for both extra ports #1 and #2. I'm recommending real hardware for the most fun in this game.
Update Thanksgiving 2010 - ad.min.prg - This version is very light (211 bytes) and tight. Custom characters and CB2 sound (see Programmer's Reference Guide, pg. 232) have both been dropped, but Protovision 4-Player Interface support (outer-most joystick port) remains. In the VICE Emulator you have to set the Settings -> Userport joystick settings... to "PET userport joy adapter" and have something specified for both extra ports #1 and #2. I'm strongly recommending real hardware for the most fun in this game. This is the coolest version yet because every trick in the book as been thrown at this code to make it extra small and ultra fast.
Survival Hint - If you have ever played Tetris and slide your piece into position at the last second, you will know what I mean when I say you can do the same thing with these asteroids. Though, it takes a sharp eye and a steady hand to cross an entire screen! What is your highest score? Mine is 765 million miles.
LOAD address $1001 0 SK=SL=F=J2=J3=.:D=RND(-TI):GOSUB13:V=36874:S=7680:C=38400 1 POKE36879,8:POKE36869,255:PRINT"&
ASSTEROYD DODGER
&":PRINT"
*
.
.;/+,- 1983
,
2010" 2 PRINT"
-USE
JOYSTICK-":PRINT"
LET'S
GO..." 3 WAIT37137,32,32:PRINT"
]
BEAMING
UP
" 4 FORA=.TO15:POKEV,138:POKEV+1,138:POKEV+2,138:POKEV+3,254:POKEV+4,A:NEXT:POKEV,.:POKEV+1,.:POKEV+2,. 5 POKEV+3,.:PRINT"
":FORA=.TO4:D=INT(RND(1)*250)+1:POKES+250+D,8:NEXT 6 D=INT(RND(1)*20)+1:PRINT"
"SPC(D)CHR$(72)"
"SPC(SK+9)"CED
" 7 SL=Z1+SK:J2=NOTPEEK(Z2):J3=NOTPEEK(Z3) 8 IF(PEEK(SL)+PEEK(SL+1)+PEEK(SL+2))<96THENPOKE214,22:PRINT"
"SPC(SK+9)"XXX
":GOTO10 9 POKEZ5,127:SK=SK-(SK>-8AND(J2AND16)/16)+(SK<9AND(J3AND128)/128):F=F+1:GOTO6 10 PRINT"
YOU
FLEW"F"
M
MILES":FORA=255TO128STEP-1:POKEV+3,A:NEXT:POKEV+3,. 11 FORA=20TO.STEP-1:POKEV+2,225+A:POKEC+A,2:POKES+A,28:POKES+A+1,32:NEXT:POKES+A+1,32:POKEV+2,. 12 PRINT"
*
YOU'RE
RESCUED
*":F=F/F:GOTO2 13 Z1=7711:Z2=37137:Z3=37152:Z5=37154:RETURN
LOAD address $1001 0 SK=1:SL=F=J2=.:D=RND(-TI):GOSUB13:S=7680:C=38400:POKE37138,128:POKE37136,.:V1=37144 1 POKEV1+3,16:POKE36869,255:PRINT"ASSTEROYD
DODGER
CB2
":PRINT"
*
.
.;/+,- %2010":GOSUB15 2 PRINT"
LET'S
GO... 3 WAIT37136,32:WAIT37136,32,32:PRINT"
]
BEAMING
UP
" 4 POKEV1+2,15:FORA=69TO61STEP-4:POKEV1,A:FORT=1TO100:NEXT:NEXT:POKEV1+2,.:POKE646,10 6 D=RND(1)*20+1:PRINT"
"SPC(D)CHR$(72)"
"SPC(SK+9)"
" 7 SL=Z1+SK:J2=NOTPEEK(Z2) 8 IFPEEK(SL)+PEEK(SL+1)<64THENPOKE214,22:PRINT"
"SPC(SK+9)"UU
":GOTO10 9 SK=SK-(SK>-8AND(J2AND4)/4)+(SK<10AND(J2AND8)/8):F=F+1:GOTO6 10 PRINT"
YOU
FLEW"F"
M
MILES":POKEV1+2,15:POKEV1,59:FORT=1TO100:NEXT:POKEV1,82:FORT=1TO100 11 NEXT:FORA=20TO.STEP-1:POKEV1,62+A:POKES+A,28:POKEC+A,104:POKES+A+1,32:NEXT:POKES+A+1,32 12 POKEV1+2,0:PRINT"
YOU'RE
RESCUED":F=F/F:GOTO2 13 Z1=7711:Z2=37136:Z3=214:Z5=22 14 POKE36878,104:POKE36879,250:RETURN 15 PRINT"
GAME
FEATURES:" 16 PRINT"
.MULTI-
C
O
L
O
R
GRAPHICS" 17 PRINT"
.FASTER
PLAY" 18 PRINT"
.CB2 SOUND!" 19 PRINT"
.PROTOVISION JSTICK":RETURN
LOAD address $1001 1 K=9:D%=L=J=.:Z=7702:Q=37136:T=TI:POKEQ-257,8:POKEQ,.:POKEQ+2,128:PRINT"2 PRINT"
"SPC(K)"
V
":D%=RND(.)*21:J=NOTPEEK(Q):IFPEEK(Z+K)<32THENPRINT"
"TI-T"
KM":WAITQ,32,32:RUN 3 K=K-(K>0AND(JAND4)/4)+(K<20AND(JAND8)/8):PRINT"
"SPC(D%)"O":GOTO2