Jump to content
IGNORED

Things in the Dark


adamantyr

Recommended Posts

Here's a game that we typed in on the TI-99/4a a very long time ago... I'm not sure of the original source. I know we didn't find it in Compute! magazine, because I have an archive disk of all issues and I've never seen it there. I'm pretty sure this one was another "for all platforms", since anyone who knew TI BASIC would know that updating counters are NOT advisable.

What impresses me is that the opening title sequence is pretty neat... although the game itself is rather simple. Also on Classic99, the music has this nasty high-pitch in the background... or maybe it was always there and I never heard it on iron? Dunno.

Code is below, it should be easily cut-and-paste able into Classic99.

 

100 GOSUB 1200
110 GOSUB 710
120 GOSUB 1030
130 GOSUB 1800
140 GOTO 190
150 FOR I=1 TO LEN(H$)
160 CALL HCHAR(R,C+I,ASC(SEG$(H$,I,1)))
170 NEXT I
180 RETURN
190 CALL CLEAR
200 PRINT TAB(2);"GC=0";TAB(23);CHR$(136): :
210 PRINT TAB(2);"SC=0";TAB(13);"L=";STR$(LV);TAB(23);"T=";STR$(TM-(LV-1)*10)
220 PRINT: : : : : : : : : : : : : : : : : : : :
230 CALL HCHAR(4,1,126,32)
240 RANDOMIZE
250 FOR I=1 TO 5
260 R=INT(RND*20)+5
270 C=INT(RND*31)+1
280 IF(R=13)*(C=16)THEN 260
290 CALL HCHAR(R,C,G(RND*3))
300 NEXT I
310 CALL HCHAR(RR,RC,G(7))
320 OLDRC=RC
330 OLDRR=RR
340 H$=STR$(T)&" "
350 R=3
360 C=26
370 GOSUB 150
380 IF T=0 THEN 2350
390 CALL KEY(0,K,S)
400 IF K=80 THEN 2720
410 IF(K<>68)*(K<>69)*(K<>83)*(K<>88)THEN 440
420 DX=(K=83)-(K=68)
430 DY=(K=69)-(K=88)
440 RR=RR+DY+(RR=5)*20*(DY=-1)-(RR=24)*20*(DY=1)
450 RC=RC+DX+(RC=1)*31*(DX=-1)-(RC=31)*30*(DX=1)
460 CALL HCHAR(OLDRR,OLDRC,32)
470 CALL GCHAR(RR,RC,L)
480 IF L=32 THEN 540
490 FOR I=0 TO 6
500 IF L<>G(I)THEN 530
510 ON I+1 GOTO 1920,1950,2010,2070,2190,2280,2070
520 I=6
530 NEXT I
540 CALL HCHAR(RR,RC,G(7))
550 IF GC=0 THEN 640
560 GC=GC-1
570 R=1
580 C=6
590 H$=STR$(GC)&" "
600 GOSUB 150
610 IF(GC<>0)+(GF=0)THEN 640
620 CALL HCHAR(SNR,SNC,G(6))
630 GF=0
640 T=T-1
650 R=RND*19+5
660 C=RND*30+1
670 CALL GCHAR(R,C,L)
680 IF(L<>32)+(RND*3<1)THEN 320
690 CALL HCHAR(R,C,G(RND*3))
700 GOTO 320
710 CALL CLEAR
720 CALL SCREEN(2)
730 PRINT TAB(2);"ppppp"
740 PRINT TAB(4);"p p p p p p rppq rpq"
750 PRINT TAB(4);"p p p p pq p p p"
760 PRINT TAB(4);"p pppp p psqp p rq spq"
770 PRINT TAB(4);"p p p p p sp p p p"
780 PRINT TAB(4);"p p p p p p sppt spt": : : :
790 PRINT TAB(;"I N T H E": : : :
800 PRINT TAB(9);"pppq rppq pppq p r"
810 PRINT TAB(9);"p p p p p p p rt"
820 PRINT TAB(9);"p p p p p t prt"
830 PRINT TAB(9);"p p pppp pppq psq"
840 PRINT TAB(9);"pppt p p p p p sq": : : :
850 GOSUB 2740
860 CALL CLEAR
870 FOR I=3 TO 8
880 CALL COLOR(I,16,2)
890 NEXT I
900 PRINT "LAND THE ROBOT.. ";CHR$(136);"ON GREM-","LINS.. ";CHR$(128);" 10 PTS, BLOCKHEADS"
910 PRINT "x 100 PTS, SNAKES.. ";CHR$(125);" 200","PTS, CYAN GRAPS.. ";CHR$(106);" 400 PTS.",,
920 PRINT " AVOID THE NORFS.. ";CHR$(117);". BOTH","THE ROBOT AND THE NORF"
930 PRINT "DISAPPEAR WHEN THEY TOUCH.","TOUCHING A RED GRAP IS LIKE"
940 PRINT "TOUCHING A NORF. DINITS..";
950 PRINT CHR$(99);"REPEL NORFS.": :
960 PRINT "YOU MUST SCORE BEFORE THE","TURN COUNTER T REACHES 0."
970 PRINT "THE GRAPS REMAIN CYAN UNTIL","THE GRAP COUNTER REACHES","0. YOU EARN ONE CHANCE AT A"
980 PRINT "SNAKE EVERY 1000 PTS AND AT","A GRAP EVERY SNAKE. PRESS P","TO PAUSE THE ACTION, R TO","RESTART.",,,
990 PRINT TAB(2);"PRESS ANY KEY TO CONTINUE"
1000 CALL KEY(0,K,S)
1010 IF S=0 THEN 1000
1020 RETURN
1030 CALL CLEAR
1040 PRINT "ADVANCE (A)/NO ADVANCE (N) ";
1050 CALL KEY(0,K,S)
1060 IF S=0 THEN 1050
1070 IF(K<>65)*(K<>78)THEN 1050
1080 PRINT CHR$(K)
1090 AD=-(K=65)
1100 PRINT: : : : : :
1110 PRINT " LEVEL 1-6 (1 IS EASIEST) ";
1120 CALL KEY(0,K,S)
1130 IF S=0 THEN 1120
1140 IF(K<49)+(K>54)THEN 1120
1150 PRINT CHR$(K)
1160 LV=K-48
1170 T=60-(LV-1)*10
1180 RETURN
1190 REM REDEFINE CHARACTERS
1200 CALL CLEAR
1210 PRINT TAB(9);"PLEASE WAIT..."
1220 FOR I=112 TO 116
1230 READ A$
1240 CALL CHAR(I,A$)
1250 NEXT I
1260 FOR I=1 TO 9
1270 READ A,A$
1280 CALL CHAR(A,A$)
1290 NEXT I
1300 FOR I=5 TO 7
1310 CALL COLOR(I,9,2)
1320 NEXT I
1330 CALL COLOR(2,16,2)
1340 FOR I=9 TO 14
1350 READ A,B
1360 CALL COLOR(I,A,B)
1370 NEXT I
1380 DATA FFFFFFFFFFFFFFFF,80C0E0F0F8FCFEFF,010370F1F3F7FFF
1390 DATA FF7F3F1F0F070301,FFFEFCF8F0E0C080
1400 DATA 99,415D2A1C2A491436,106,427E5A3CE781C300,117,7E99FFC35A7E2466
1410 DATA 118,427E5A3CE781C300,120,7E5A7EFF183C2466
1420 DATA 125,00003079AFC20000,126,000000FFFF000000
1430 DATA 128,1824183C7E3C42C3,136,1824187E5A5A183C
1440 DATA 4,2,8,2,9,2,11,2,13,2,15,2
1450 FOR I=0 TO 7
1460 READ A
1470 G(I)=A
1480 NEXT I
1490 REM CHAR$ & POINT VALUE DATA
1500 DATA 99,128,120,117,106,125,118,136
1510 FOR I=0 TO 6
1520 READ PT(I)
1530 NEXT I
1540 DATA 0,10,100,0,400,200,0
1550 DIM VOC1(96),VOC2(96)
1560 FOR I=1 TO 96
1570 READ VOC1(I)
1580 IF VOC1(I)<>0 THEN 1600
1590 VOC1(I)=40000
1600 NEXT I
1610 FOR I=1 TO 96
1620 READ VOC2(I)
1630 IF VOC2(I)<>0 THEN 1650
1640 VOC2(I)=40000
1650 NEXT I
1660 REM MUSIC DATA
1670 DATA 175,0,262,0,262,0,175,0,262,0,262,0,175,0
1680 DATA 262,0,262,0,175,0,262,0,262,0
1690 DATA 131,0,262,0,262,0,131,0,262,0,262,0,131,0,262,0,262,0,131,0
1700 DATA 262,0,262,0,175,0,262,0,262,0,175,0,262,0,262,0
1710 DATA 175,0,262,0,262,0,175,0,262,0,262,0,131,0,262,0
1720 DATA 262,0,131,0,262,0,262,0,175,175,175,175,175,175,175,175,175,175,175,175
1730 DATA 415,0,0,0,0,0,466,0,0,0,0,0
1740 DATA 523,554,523,554,523,554,523,554,523,0,0,0,0,0
1750 DATA 392,0,0,0,0,0,415,0,0,0,0,0
1760 DATA 466,523,466,523,466,523,466,0,0,0,0,0,415,0,0,0,0,0
1770 DATA 466,0,0,0,0,0,523,554,523,554,523,554,523,0,0,0,0,0
1780 DATA 392,0,415,0,466,0,523,523,523,523,466,466,415,415,415,415,415,415,415,415,415,415,415,415
1790 RETURN
1800 TM=60
1810 SC=0
1820 RR=13
1830 RC=16
1840 NR=2
1850 AR=0
1860 GR=0
1870 SF=0
1880 GF=0
1890 DX=1
1900 RETURN
1910 REM DENIT
1920 CALL SOUND(100,110,2)
1930 GOTO 520
1940 REM GREMLIN
1950 FOR J=0 TO 30 STEP 5
1960 CALL SOUND(100,392,J)
1970 NEXT J
1980 GOSUB 2440
1990 GOTO 520
2000 REM BLOCKHEAD
2010 FOR J=30 TO 0 STEP-10
2020 CALL SOUND(100,294,J)
2030 NEXT J
2040 GOSUB 2440
2050 GOTO 520
2060 REM NORF & RED GRAP
2070 CALL SOUND(150,-3,2)
2080 NR=NR-1
2090 CALL HCHAR(RR,RC,32)
2100 T=TM-(LV-1)*10+1
2110 IF NR=0 THEN 2350
2120 CALL HCHAR(1,25,32)
2130 RR=13
2140 RC=16
2150 DX=1
2160 CALL HCHAR(13,17,32)
2170 GOTO 520
2180 REM CYAN GRAP
2190 FOR J=0 TO 30 STEP 5
2200 CALL SOUND(100,1175,J,-3,J)
2210 NEXT J
2220 GF=0
2230 SF=0
2240 GOSUB 2440
2250 GC=1
2260 GOTO 520
2270 REM SNAKE
2280 FOR J=0 TO 30 STEP 5
2290 CALL SOUND(100,4000,J)
2300 NEXT J
2310 SF=0
2320 GF=-1
2330 GOSUB 2440
2340 GOTO 520
2350 REM END OF GAME SOUND
2360 H$="PLAY AGAIN (Y/N)?"
2370 R=2
2380 C=8
2390 GOSUB 150
2400 CALL KEY(0,K,S)
2410 IF(K<>78)*(K<>89)THEN 2400
2420 IF K=89 THEN 120
2430 STOP
2440 R=3
2450 C=6
2460 SC=SC+PT(I)
2470 GR=GR+PT(I)
2480 AR=AR+PT(I)
2490 H$=STR$(SC)
2500 FOR J=1 TO LEN(H$)
2510 CALL HCHAR(R,C+J,ASC(SEG$(H$,J,1)))
2520 NEXT J
2530 IF(GR<1000)+((GR>=1000)*((SF=1)+(GF=1)))THEN 2700
2540 IF GF=-1 THEN 2580
2550 I=5
2560 SF=1
2570 GOTO 2620
2580 I=4
2590 GF=1
2600 GC=21
2610 GR=GR-1000
2620 SNR=RND*19+5
2630 SNC=RND*30+1
2640 CALL GCHAR(SNR,SNC,L)
2650 IF L<>32 THEN 2620
2660 CALL HCHAR(SNR,SNC,G(I))
2670 IF AR<5000 THEN 2700
2680 AR=AR-5000
2690 LV=LV+1+(LV>5)
2700 T=TM-(LV-1)*10+1
2710 RETURN
2720 CALL KEY(0,K,S)
2730 IF K<>82 THEN 2720 ELSE 410
2740 FOR I=1 TO 96
2750 CALL SOUND(100,VOC1(I),2,VOC2(I),2)
2760 NEXT I
2770 RETURN

 



Enjoy!

Adamantyr

 

Edited by adamantyr
Link to comment
Share on other sites

This game is using 40,000hz as a silent rest, so you're hearing artifacting between that frequency and the sample rate that the emulator is actually using. When I put the DAC code back in that will go away, since I'll disallow the higher frequencies. Sorry in the meantime!

Link to comment
Share on other sites

  • 1 month later...

This game actually is from "Compute!" magazine [#55; December 1984].

 

Here's the story/info from the introduction page in that issue:

 

http://www.atarimagazines.com/compute/issue55/dark.php

 

It's not noted in the info, but you can freeze the game by pressing [P]ause and continue by pressing [R]estart.

 

From my text file of thoughts on all the software I have: "....paced for children, this became one of my faves back then. I used to photocopy various TI games from the school library's magazine collection and I specifically remember getting this one & liking it a lot."

 

Some changes I made (not recent; back when I typed it in):

 

- modified some of the colours to what I thought looked nicer

- added a routine to print messages on the screen character by character instead of just

with PRINT statement and scrolling

- removed REM statements + added a couple in the beginning (I like programs

to have the name mentioned in the first three lines)

- CALL KEY statements changed to CALL KEY(3,?,?) instead of (0,?,?)

- added the colour-cycling at the end

 

- removed

 

98 PRINT "ADVANCE (A)/NO ADVANCE (N) ";

99 CALL KEY(0,K,S)

100 IF S=0 THEN 99

101 IF(K<>65)*(K<>78)THEN 99

102 PRINT CHR$(K)

103 AD=-(K=65)

 

I could find no purpose for this and whatever it was supposed to be for was

apparently not implemented. The "AD" identification was never referred to again in

the program, so it seemed worthless.

 

- CALL CLEARs the screen before stopping if you choose to not play again

 

 

 

*** NOTE: FILE ATTACHMENT REMOVED; SEE FIXED VERSION BELOW ***

Edited by GratedTopping
Link to comment
Share on other sites

 

 

Some changes I made (not recent; back when I typed it in):

 

- modified some of the colours to what I thought looked nicer

- added a routine to print messages on the screen character by character instead of just

with PRINT statement and scrolling

- removed REM statements + added a couple in the beginning (I like programs

to have the name mentioned in the first three lines)

- CALL KEY statements changed to CALL KEY(3,?,?) instead of (0,?,?)

- added the colour-cycling at the end

 

- removed

 

98 PRINT "ADVANCE (A)/NO ADVANCE (N) ";

99 CALL KEY(0,K,S)

100 IF S=0 THEN 99

101 IF(K<>65)*(K<>78)THEN 99

102 PRINT CHR$(K)

103 AD=-(K=65)

 

I could find no purpose for this and whatever it was supposed to be for was

apparently not implemented. The "AD" identification was never referred to again in

the program, so it seemed worthless.

 

- CALL CLEARs the screen before stopping if you choose to not play again

This is actually a trickier game than first impression suggests, mostly at the higher levels. For example, at level 6 the timer is set to 10 only, and so you have to really think quickly about the shortest path to the next monster to eat in order to reset it, and this can be quite tricky given that the density of monsters is inversely proportional to the level of play. The presentation is superb and key response brisk. I am going to post it on the Gameshelf site with the next update and will give you credit for your modifications :) Also thanks Adam for resurrecting it!

BTW, there is a typo on line 121.

Edited by Vorticon
Link to comment
Share on other sites

* Whoops, that's right. Line 121 had a mistake that prevented the quotation marks properly being shown around a couple letters. I fixed that. I guess during my last revision in the day, I never ran it after that last change!

 

* I was wrong about it not being mentioned about the pause/restart keys...they WERE originally mentioned inside the program. I thought I was a cool kid and added that info myself!

 

* Also...it seems that there always was a character-by-character routine, but it wasn't

used for every message. I know that I added a bunch of GOSUB statements and I tried

to better-arrange the flow/appearance of the program.

 

* I see that I also added a CALL SCREEN(2) right at the start before the CALL CLEAR. I always remember doing that in any BASIC program since I wanted the screen to 'disappear' as fast as possible; I never liked that the screen turns green at the start of any program.

 

So, this would be a good thing for the GAMESHELF. If you want to just put the original at the site, maybe folks would like that better. Or maybe a zip file containing the original and my version?

TID FIXED.zip

Edited by GratedTopping
  • Like 1
Link to comment
Share on other sites

  • 12 years later...

I am the original author of Things in the Dark, both the article - which was edited by Compute! staff - and the BASIC code, which wasn't. 

The Advance/No Advance option advances the game or keeps the game at the initial level, respectively, so that code is necessary, as is all the code.

I haven't typed the code from the online article since I have it on disk already, so I can't verify the accuracy of the upload, though it looks pretty good to me. :)

Thanks to whomever uploaded it. :)

 

  • Like 4
  • Thanks 1
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...