Aliens Game for the Model 100

This was the first game I published in the early 1980’s for the Model 100 family and it quickly spread all over the world. The editor said it was some of the most efficient code he had ever seen. Already, the IBM PC was taking over the world and I moved over to DOS because of its open architecture.

trs80-100

0 'ALIENS AUTHOR FRANCIS BUSSIERE
1 'CLUB 100 Library - 415/939-1246 BBS, 937-5039 NEWSLETTER, 932-8856 VOICE
2 CLS: GOTO 11
3 POKE 63033,A(T,0): POKE 63034,A(T,1): CALL 19268,C,0: RETURN
4 Y=T: SOUND 16383,2: FOR L=1 TO 2: LINE ((B-279)*6+2,55)-((B-279)*6+2,0),L: NEXT: FOR T=0 TO 6
5 IF A(T,1)=B-278 THEN BEEP: C=32: GOSUB 3: S!=S!+A(T,2)*A(T,0)*10: A(T,0)=1: A(T,1)=RND(1)*20+10: A(T,2)=C(INT(RND(1)*3))
6 NEXT: T=Y: RETURN
7 B=B-1: IF B316 THEN B=316
10 PRINT@B,B$;: RETURN
11 DEFINT A-Z: DIM A(6,2),C(2): B$=" ": T$="TOP SCORE: ": X=1000: B=298: PRINT@B,B$;: DATA 42,144,176: FOR T=0 TO 2: READ C(T): NEXT
12 FOR T=0 TO 6: A(T,0)=1: A(T,1)=T*5+3: A(T,2)=C(INT(RND(1)*3)): NEXT
13 FOR T=0 TO 6: X=X-1: C=32: GOSUB 3: A(T,0)=A(T,0)+1: IF A(T,0)>7 THEN A(T,0)=1: IF A(T,1)=B-278 THEN GOTO 19
14 A(T,1)=A(T,1)+(RND(1)>.5)-(RND(0)<=.5): IF A(T,1)40 THEN A(T,1)=1
16 C=A(T,2): GOSUB 3: IF X"" THEN K=ABS(ASC(K$)-31): ON K GOSUB 4,,,,,,,,,,,,7,,9
17 NEXT
18 GOTO 13
19 PRINT@0,"GAME OVER": IF S!>VAL(RIGHT$(T$,15)) THEN S$=STR$(S!): FOR L=1 TO LEN(S$): POKE PEEK(VARPTR(T$)+1)+256*PEEK(VARPTR(T$)+2)+12+L,ASC(MID$(S$,L,1)): NEXT