2K Games Pack

Products: 2K Games Pack
Date: 1982
Type: Program
Platform(s): TS 1000
Tags: Game

This pack contains six BASIC games designed to run on an unexpanded (2K RAM) machine: AWALK (guide a figure to a target), CPATROL (side-scrolling shooting game), DRAGON (escape a pursuing dragon using INPUT-based moves), KWHALE (submarine dodging a whale and shark), MMASH (two-character collision game), and SBLAST (altitude-descent shooter). Each game makes heavy use of block graphics characters for in-game sprites and scenery, and several use RAND USR calls into ROM routines (notably SBLAST’s use of RAND USR 16516 as a delay/sync mechanism). SBLAST also employs direct POKE statements to system variables (addresses 16686, 16387, 16674) to control display behavior. The pack demonstrates various techniques for fitting playable games into the tight 2K RAM constraint, including minimal variable usage, compact movement logic, and reusing the screen as game state.


Program Analysis

This cassette pack contains six independent BASIC games, each saved under its own name. All are engineered to fit within the 2K RAM limit of an unexpanded machine. The games are: AWALK, CPATROL, DRAGON, KWHALE, MMASH, and SBLAST.

AWALK — Program Structure

AWALK is a maze-free navigation game where the player steers a figure (drawn with block graphics at lines 4647) toward a randomly placed target. Movement uses keys 5/6/7/8 detected via INKEY$ comparisons embedded directly in LET arithmetic at lines 5657. The screen is pre-filled with a block character in FAST mode (lines 28), then the game runs in SLOW. The main loop at lines 4566 stores previous positions in RE/CE and R/C, erases the old sprite positions by reprinting the background block character, and checks collision at line 60. Score counts moves taken; a 100-move limit triggers line 103.

CPATROL — Program Structure

CPATROL is a horizontally scrolling shoot-em-up. A plane sprite moves right across the screen, and the player controls vertical position with keys 6/7. A bomb drops when FA=2 (a 1-in-6 RND chance at line 137138), animated by a FOR loop printing [+] downward. A target (BA) is placed randomly when QA=0 and locked at column 16 after a hit (QA=1). The INKEY$ ="9" fires a missile (line 145235). Lines 235249 handle hit detection. The game ends on boundary violation (line 144) or a successful “rescue” sequence (lines 260267).

DRAGON — Program Structure

DRAGON is a turn-based evasion game using INPUT I for 8-directional moves (lines 100140). The player ([H]) moves away from a pursuing dragon ([D]) which closes in by simple sign-following logic (lines 180210). Previous positions are saved in R/C and D/E for erasure. The score S counts moves survived; lines 300330 assign a rating string (ROOKIE / AVERAGE / STAR) based on thresholds. Boundary crossing triggers the end (line 145). A replay prompt at line 340 uses INPUT P with a non-zero truth test.

KWHALE — Program Structure

KWHALE simulates a submarine (the player sprite at A,B) crossing a screen filled with a wave-texture block character. A shark (["][~~]▞) and a torpedo ([O][=][<]) approach from the right. The torpedo column C decrements each loop (line 156) and wraps at column 2. A dive timer T counts down when the sub goes deep; reaching zero causes “NO AIR” (line 300). Hit detection between the torpedo and shark is at line 116, and whale collision at line 120. The variable G tracks shark kills; J=255 is a flag for a chomped submarine. Lines 150155 handle the torpedo respawning with a new random vertical offset V.

MMASH — Program Structure

MMASH is a two-entity collision game. The player controls a ghost-like sprite (["]) with keys 5/6/7/8; an auto-chasing monster uses simple coordinate-following logic (lines 130160). The screen border is drawn with solid and block characters in FAST mode at startup. Previous positions (RE/DE) are blanked each frame (lines 165166). Collision is tested at line 120. The flag DD=1 controls step size. The game ends either on collision (line 500) or when the monster reaches the corner at row 16, column 24 (line 163).

SBLAST — Notable Techniques

SBLAST is the most technically interesting game in the pack. It uses three direct POKE statements to system variables:

  • POKE 16686,5 — adjusts the display file pointer
  • POKE 16387,17 — modifies a system variable to alter display behavior
  • POKE 16674,128 — sets a system variable related to the display

It also calls RAND USR 16516 twice per main loop iteration (lines 270 and 302) to invoke a ROM routine directly, likely for timing or display synchronization. A DIM C(44) array stores asteroid column positions, though only indices 1–27 are used in the main loop. The altitude counter T starts at 2000 and decrements by 20 per cycle, giving approximately 100 iterations before game over. The spaceship ([=][>]) moves vertically with keys 6/7 within bounds 4–18.

Line 10 REM Block

The large REM statement at line 10 of SBLAST (before the SAVE "SBLAS[T]" at line 29) contains what appears to be machine code or tokenized data stored as a remark, a well-known technique for embedding binary data in BASIC programs that is protected from the BASIC interpreter but accessible via USR. The RAND USR 16516 calls earlier in the program likely execute code whose entry point falls within or near this REM block’s address space.

Common BASIC Idioms

Several idioms appear consistently across the six games:

  • Boolean arithmetic in LET for movement: LET A=A+(INKEY$="6")-(INKEY$="7") — evaluates the boolean as 1 or 0.
  • Saving and restoring sprite positions using paired variables (R/C for old, A/B for new) to erase and redraw without CLS.
  • RND-based clamped random placement: INT(RND*N)+offset throughout all games.
  • Screen pre-fill in FAST mode followed by SLOW for gameplay, minimizing visible rendering delay.
  • IF P THEN GOTO using a numeric input as a truth value for replay prompts (DRAGON, MMASH).

Bugs and Anomalies

  • In CPATROL, line 250 reads IF (B<>BA OR B<>B+1) AND QA=0 THEN GOTO 144 — the condition B<>B+1 is always true, making the second part of the OR redundant and the overall branch logic likely incorrect (should probably be BA+1).
  • In KWHALE, variable J is reused both as a FOR loop counter (lines 2125) and as a flag set to 255 at line 400. The test IF J<255 at line 62 relies on this dual use, which works but is fragile.
  • In DRAGON, the rating thresholds at lines 300320 overlap: a score of exactly 23–28 sets AVERAGE, then if S>28 overwrites with STAR. Scores between 20 and 22 set ROOKIE but are also above the S<20 threshold boundary; a score of exactly 20 or 21 sets ROOKIE but not AVERAGE (since S>22 is false), which appears intentional but leaves scores 20–22 rated as ROOKIE.
  • In CPATROL, line 147 tests INKEY$ ="R" which requires an uppercase R; on this hardware INKEY$ returns tokens not ASCII for most keys, but “R” entered via keyword mode may not match as expected in all contexts.

Content

Appears On

Related Products

6 great graphically illustrated games on one cassette for the unexpanded TS1000.

Related Articles

Starblaster is one of six 2k games on a tape sold by Softsync. The game uses machine language to scroll...

Related Content

Image Gallery

Source Code

   1 SAVE "AWAL[K]"
   2 FAST
   3 FOR J=0 TO 20
   4 FOR I=0 TO 30
   5 PRINT AT J,I;"[:]"
   6 NEXT I
   7 PRINT 
   8 NEXT J
  10 RAND 
  11 LET X=INT (RND*15)+2
  15 SLOW
  20 LET Y=INT (RND*16)+6
  30 LET A=15
  40 LET B=3
  41 LET S=0
  46 PRINT AT A,B;"[O]";AT A+1,B-1;"▙,,▟";AT A+2,B-1;"▙[:]▟";AT 20,8
  47 PRINT AT X-1,Y+2;"[,,][▒][,,]";AT X,Y;"[,,][▒]~~~~~~[▒][,,]";AT X+1,Y+2;"[~~][~~][~~]"
  48 LET R=X
  49 LET C=Y
  50 LET RE=A
  51 LET CE=B
  53 LET X=X+2*(RND<.5 AND X<18)-2*(RND>.5 AND X>3)
  55 LET Y=Y+2*(RND>.5 AND Y<23)-2*(RND>.5 AND Y>0)
  56 LET B=B+(INKEY$ ="8" AND B<28)-(INKEY$ ="5" AND B>1)
  57 LET A=A+(INKEY$ ="6" AND A<18)-(INKEY$ ="7" AND A>0)
  60 IF RE=R-1 AND CE=C+3 THEN GOTO 101
  61 PRINT AT R-1,C+2;"[:][:][:]";AT R,C;"[:][:][:][:][:][:][:]";AT R+1,C+2;"[:][:][:]"
  62 IF RE=A AND CE=B THEN GOTO 45
  63 PRINT AT RE,CE;"[:]";AT RE+1,CE-1;"[:][:][:]";AT RE+2,CE-1;"[:][:][:]"
  64 IF S=100 THEN GOTO 103
  65 LET S=S+1
  66 GOTO 45
 101 PRINT AT 1,5;"[T][O][T][A][L]█[M][O][V][E][S][=]";S
 103 PRINT AT 3,5;"[E][N][E][R][G][Y]█[L][E][F][T][=]";100-S
 
  
 1 SAVE "CPATRO[L]"
   9 CLS
  10 LET X=1
  15 LET QA=0
  20 LET H=10
  30 LET S=X-X
  40 LET B=X
  50 FOR A=5 TO 25
  60 PRINT AT 15,A;"[~~]"
  75 IF A<10 THEN PRINT AT 11+A,5;"▌";AT 11+A,25;"▐"
  80 NEXT A
  81 PRINT AT 19,7;"[O]  [0]";AT 20,6;"▀[P]▚▞[P]▚"
  82 PRINT AT 18,16;"["]";AT 19,15;"▞[G]▚";AT 20,15;"▗▀▖" 
 100 LET H=H+(INKEY$ ="6")-(INKEY$ ="7")
 120 PRINT AT H-X,B;"--▐--"
 130 PRINT AT H,B;"▀▀██"
 134 IF QA=1 THEN LET BA=16
 135 IF QA=0 THEN LET BA=INT (RND*14)+5
 136 IF QA=0 THEN PRINT AT 14,BA;"▟▙"
 137 LET FA=INT (RND*6)
 138 IF FA<>2 THEN GOTO 144
 139 FOR J=1 TO 14-H
 140 PRINT AT 14*J,BA;"[+]";AT 14-J,BA;" "
 141 NEXT J
 143 IF BA>=B AND BA<B+4 THEN GOTO 266
 144 IF H>=14 OR H<2 THEN STOP
 145 IF INKEY$ ="9" THEN GOTO 235
 147 IF QA=1 AND A=1 AND INKEY$ ="R" THEN GOTO 260
 150 PRINT AT H-X,B;"     "
 160 PRINT AT H,B;"    "
 170 IF B=25 THEN LET B=X
 180 IF RND>.6 THEN LET H=H+X
 190 LET B=B+X
 215 PRINT AT 14,BA;"    "
 220 GOTO 100
 235 IF B=BA OR B=BA+1 THEN LET QA=1
 240 LET S=S+X
 241 LET RE=H
 242 IF QA=1 THEN LET RE=RE-4
 245 FOR J=1 TO 14-RE
 246 PRINT AT H+J,B;"*";AT H+J,B;" "
 247 NEXT J
 248 IF B=BA+1 OR B=BA THEN PRINT AT 14,BA;"[B][O][O][M]"
 249 IF QA=1 AND B=16 THEN LET A=1
 250 IF (B<>BA OR B<>B+1) AND QA=0 THEN GOTO 144
 255 GOTO 100
 260 FOR J=H TO 18
 261 PRINT AT J,B+3;"[H]"
 262 NEXT J
 265 PRINT AT 5,5;"[<][A][L][L][-][R][I][G][H][T][>]"
 266 PAUSE 60
 267 GOTO 9
 
   1 SAVE "DRAGO[N]"
   5 SLOW
  10 LET S=1
  20 LET C$="█********************█"
  25 PRINT AT 3,5;"████████████████████"
  30 FOR J=1 TO 15
  40 PRINT AT J+3,4;C$
  50 NEXT J
  55 PRINT AT 19,5;"█[L][E][V][E][L][=]█████████████";AT 20,8;"SCORE<>"
  56 PRINT AT 18,26;"8 1 2";AT 19,26;"7 [D] 3";AT 20,26;"6 5 4";AT 21,1;"TYPE MOVE(1 TO 8)----->"
  60 LET X=INT (RND*14)+5
  70 LET Y=INT (RND*20)+5
  80 LET A=INT (RND*14)+5
  90 LET B=INT (RND*20)+5
  91 PRINT AT A,B;"[D]";AT X,Y;"[H]"
  92 IF X=A AND Y=B THEN GOTO 80
  93 LET R=A
  94 LET C=B
 100 INPUT I
 110 IF I=1 OR I=2 OR I=8 THEN LET A=A-1
 120 IF I=3 OR I=2 OR I=4 THEN LET B=B+1
 130 IF I=5 OR I=4 OR I=6 THEN LET A=A+1
 140 IF I=7 OR I=8 OR I=6 THEN LET B=B-1
 145 IF A>18 OR A<4 OR B>24 OR B<4 THEN GOTO 300
 150 LET D=X
 160 LET E=Y
 180 IF X<A THEN LET X=X+1
 190 IF X>A THEN LET X=X-1
 200 IF Y<B THEN LET Y=Y+1
 210 IF Y>B THEN LET Y=Y-1
 220 PRINT AT R,C;"▗";AT D,E;"*";AT 20,15;S
 230 LET S=S+1
 234 IF A=X AND B=Y THEN GOTO 300
 240 GOTO 91
 300 IF S<20 THEN LET U$="[R][O][O][K][I][E]"
 310 IF S>22 THEN LET U$="[A][V][E][R][A][G][E]"
 320 IF S>28 THEN LET U$="[S][T][A][R]"
 330 PRINT AT 19,12;U$
 340 PRINT AT 21,1;"AGAIN? 1(Y) OR 0(N)"
 350 INPUT P
 355 CLS
 360 IF P THEN GOTO 5
 
   1 SAVE "KWHAL[E]"
   8 LET C=24
   9 LET V=5
  10 LET G=0
  19 FAST
  20 LET A=2
  21 FOR I=0 TO 19
  22 FOR J=1 TO 26
  23 PRINT AT I,J;"[▒]"
  24 NEXT J
  25 NEXT I
  26 SLOW
  27 LET B=1
  30 LET H=INT (RND*13)+9
  40 LET K=INT (RND*10)+10
  51 LET T=INT (RND*30)+20
  60 PRINT AT 2,1;"[,,][,,][,,][,,][,,][,,][,,][,,][,,][,,][,,][,,][,,][,,][,,][,,][,,][,,][,,][,,][,,][,,][,,][,,][,,][,,]";AT A,B;"▙██[.]";AT A+1,B;"▛[,,][,,][,,]"
  61 IF G<1 THEN PRINT AT K,H;"["][~~]▞"
  62 IF J<255 THEN PRINT AT K-V,C-1;"[O][=][<]"
  65 LET Q=A
  75 LET A=A+(INKEY$ ="6")-(INKEY$ ="7")
  90 LET B=B+1
 100 IF A>2 THEN LET T=T-1
 110 IF T<21 THEN PRINT AT 2,14;"[R][I][S][E]"
 113 IF T=15 OR T=8 THEN PRINT AT K,H;"[▒][▒][▒]"
 115 IF T=15 THEN LET H=ABS (H-4)
 116 IF (A+1=K-V OR A=K-V) AND B+4>=C AND C>B+2 THEN GOTO 400
 120 IF (A=K-1 OR A=K) AND B+3=H THEN GOTO 200
 130 IF T=0 THEN GOTO 300
 140 PRINT AT Q,B-1;"[▒][▒][▒][▒]";AT Q+1,B-1;"[▒][▒][▒][▒]";AT K-V,C;"[▒][▒]"
 149 IF C=2 THEN PRINT AT K-V,1;"[▒]"
 150 IF T<21 AND A<2 THEN GOTO 50
 151 IF C=2 THEN LET V=INT (RND*6)
 155 IF C=2 THEN LET C=26
 156 LET C=C-1
 160 IF B=24 THEN LET B=1
 170 GOTO 60
 200 LET G=G+1
 220 GOTO 401
 300 PRINT "NO AIR"
 310 STOP
 400 LET J=255
 401 PRINT AT A-2,C;"[C][H][O][M][P]"
 402 PAUSE 80
 403 PRINT AT A-2,C;"[▒][▒][▒][▒][▒]"
 405 IF G=0 OR J<255 THEN GOTO 140
 
   1 SAVE "MMAS[H]"
   3 FAST
   4 FOR I=0 TO 19
   5 FOR J=1 TO 28
   6 IF J=1 OR J=28 OR I=0 OR I=19 THEN PRINT "█";
   7 IF J<>1 AND J<>28 AND I<>0 AND I<>19 THEN PRINT "[▒]";
   8 NEXT J
   9 PRINT 
  10 NEXT I
  11 SLOW
  12 PRINT AT 19,11;"[S][C][O][R][E][-]"
  13 LET DD=1
  14 LET S=0
  15 LET A$="[*][~~][*]"
  20 LET B$="▜["]▛"
  25 PRINT AT 15,23;"[~~][~~][~~][~~]"
  30 LET K=3
  40 LET L=19
  60 LET G=INT (RND*13)+3
  70 LET H=2
  80 IF K+1=G AND L+1=H THEN GOTO 30
  90 PRINT AT G,H;"["]";AT G+1,H-1;"[,,]█[,,]";AT G+2,H-1;"▞[▒]▚";AT K,L;A$
 100 PRINT AT K+1,L;B$
 110 PRINT AT 19,17;S
 120 IF K+1=G AND (L+1=H OR L+2=H) THEN GOTO 500
 122 LET RE=K
 124 LET DE=L
 130 IF G>K+1 THEN LET K=K+1
 140 IF L+1>H THEN LET L=L-1
 150 IF K+1>G THEN LET K=K-1
 160 IF H>L+1 THEN LET L=L+1
 163 IF G=16 AND H=24 THEN GOTO 510
 165 PRINT AT G,H;"[▒]";AT G+1,H-1;"[▒][▒][▒]";AT G+2,H-1;"[▒][▒][▒]"
 166 PRINT AT RE,DE;"[▒][▒][▒][▒]";AT RE+1,DE;"[▒][▒][▒][▒]"
 170 IF INKEY$ ="5" THEN LET H=H-DD
 180 IF INKEY$ ="8" THEN LET H=H+DD
 190 IF INKEY$ ="6" THEN LET G=G+DD
 200 IF INKEY$ ="7" THEN LET G=G-DD
 230 LET S=S+1
 250 GOTO 90
 500 PRINT AT K+1,L+1;"[U]"
 510 PRINT AT 21,2;"RUN AGAIN [T][Y][P][E] 1 OR 0"
 520 INPUT W
 522 CLS
 530 IF W THEN GOTO 2
 
  10 REM 11UIINKEY$  RETURN- AND [)]RNDY MIINKEY$ UJINKEY$ CHR$  ASN [5]RND RETURN+ABS [5]RND#[A]RNDY-MJINKEY$  PRINT UJINKEY$ # LET UIINKEY$ █ RETURN- AND VAL RNDA I-UIINKEY$ #▞  GOSUB PI#MJINKEY$  GOSUB #£RND: COPY PRINT UIINKEY$ # LET A ▞ , RETURN#ASN  TO RND<#STR$ RND£[B] FAST GOSUB PI LPRINT ASN  GOTO RND<#USR RND▞  PRINT UJINKEY$ # LET VAL STR$  LPRINT 7# RETURN#TAB  RUN RND FAST[B] GOSUB #F##CHR$   LPRINT TAB (INKEY$  FASTSGN #9INKEY$ XTAB /INKEY$ <#5INKEY$ ▞ "<STR$  LPRINT 7 GOSUB [K]Y█><AT "#CHR$  TAB  POKE RNDTAN ▌)111
  11 REM 
  29 SAVE "SBLAS[T]"
  30 DIM C(44)
  35 LET T=2000
  36 LET A=8
  37 LET S=0
  38 LET V=1
 200 PRINT AT 1,5;"ALTITUDE=";T
 201 POKE 16686,5
 202 POKE 16387,17
 203 POKE 16674,128
 220 FOR J=1 TO 28
 230 IF J>4 AND J<18 THEN PRINT AT J,30;" "
 240 LET C(J)=INT (RND*13)+5
 250 NEXT J
 255 PRINT AT 1,1;" TO RERUN TY"
 256 PRINT AT 1,12;"PE>GOTO 30"
 257 PRINT AT 3,7;"ALTITUDE="
 260 FOR J=1 TO 27
 270 RAND USR 16516
 280 PRINT AT C(J),30;"[*]"
 290 NEXT J
 300 PRINT AT A,1;"[=][>]"
 302 RAND USR 16516
 305 IF A=C(V) THEN LET S=S+1
 306 LET V=V+1
 308 PRINT AT C(V),30;"[*]"
 310 LET A=A+(INKEY$ ="6" AND A<18)-(INKEY$ ="7" AND A>4)
 311 LET T=T-20
 312 PRINT AT 3,17;T;" "
 313 IF T=0 THEN GOTO 400
 316 IF V=28 THEN LET V=1
 340 GOTO 300
 400 PRINT AT 18,23;"SCORE=";S
 401 PAUSE 80
 402 CLS
 403 GOTO 30

Note: Type-in program listings on this website use ZMAKEBAS notation for graphics characters.

People

No people associated with this content.

Scroll to Top