100 REM - CLUES Prototype A›110 REM - by Joel Gluck / April '84›120 REM - "Our Game"›130 REM - ANALOG Computing June '84›200 GOSUB 1000:REM - Intro/Options›210 GOSUB 2000:REM - Initialize›220 GOSUB 3000:REM - Init. Screen›230 GOSUB 4000:REM - Game›240 GOSUB 5000:REM - End›250 IF PLAYAGAIN=1 THEN 220›260 END ›1000 REM - Éîôòï¯Ïðôéïîó›1100 GRAPHICS 0›1110 ? "Welcome to ÃÌÕÅÓ (version A)!"›1112 ? :? " 'A minute to learn,":? " two minutes to master.'"›1120 ? :? "Object: Find the èéääåî ôòåáóõòå":? "as fast as you can."›1130 ? :? "Directions: Use joystick #1 to move":? "your Seeker (the ) to a point on the"›1140 ? "grid where you think the treasure":? "might be and then press the joystick"›1150 ? "trigger. If you are correct, you win! If not, a ÃÌÕÅ will appear.":? "The ÃÌÕÅ will be either an arrow or"›1160 ? "a number. An arrow points in the":? "general direction of the treasure."›1170 ? "A number tells your approximate":? "distance from the treasure."›1180 ? :? "Good luck and have fun!"›1190 ? :? "Press ÓÔÁÒÔ to begin...";›1200 IF PEEK(53279)<>6 THEN 1200›1210 SETCOLOR 4,12,6:REM - acknowledge key press by changing border color›1220 RETURN ›2000 REM - Éîéôéáìéúå›2100 DIM XS(15),YS(15):REM - joystick direction storage›2200 FOR Z=5 TO 15:REM - possible joystick values›2210 READ A,B:REM - READ direction values into dummy variables›2220 XS(Z)=A:YS(Z)=B:REM - store direction values›2230 NEXT Z›2240 REM - direction values:›2250 DATA 1,1,1,-1,1,0,0,0,-1,1,-1,-1,-1,0,0,0,0,1,0,-1,0,0›2300 REM - ARROW graphics values:›2310 DIM CH$(1),ARROW(8):REM - arrow graphic storage›2320 FOR Z=0 TO 8:REM - possible arrow values›2330 READ CH$:ARROW(Z)=ASC(CH$(1,1))+128:REM - read arrow char. and convert to numerical code +128 for reverse›2340 NEXT Z›2350 REM - arrow characters:›2360 DATA ,<,,^,?,V,,>,›2400 REM - other graphics:›2410 WALL=ASC(" ")›2420 GRID=ASC(".")›2430 SEEKER=ASC("")›2440 NUMBER=ASC("0")+128:REM - base number is zero, +128 for reverse field›2500 RETURN ›3000 REM - Éîéô® Óãòååî›3100 GRAPHICS 0›3110 SETCOLOR 2,0,0:SETCOLOR 4,7,4:REM - background and border color›3120 POKE 752,1:REM - make cursor invisible›3200 COLOR WALL›3210 PLOT 0,0:DRAWTO 39,0:DRAWTO 39,23:DRAWTO 0,23:DRAWTO 0,0:REM - draw outside wall›3250 COLOR GRID›3260 FOR X=1 TO 38:REM - grid breaks down into 38 columns›3270 PLOT X,1:DRAWTO X,22:REM - draw one column of grid pattern at X›3280 NEXT X›3300 XSK=19:YSK=11:REM - starting coordinates of the Seeker›3310 COLOR SEEKER:PLOT XSK,YSK:REM - draw Seeker›3320 UNDER=GRID:REM - "underneath" the Seeker is blank grid space›3400 XTRS=INT(RND(1)*38)+1:REM - x- coordinate of the treasure›3410 YTRS=INT(RND(1)*22)+1:REM - y- coordinate of the treasure›3420 IF XTRS=XSK AND YTRS=YSK THEN 3400:REM - prevent treasure from being right under Seeker's feet at start!›3500 RETURN ›4000 REM - Çáíå›4100 POKE 20,0:POKE 19,0:REM - set timer to zero›4110 GUESSES=0›4120 FOR V=15 TO 0 STEP -0.5:SOUND 0,100,10,V:NEXT V:REM - starting bell›4200 REM - game shell›4210 S=STICK(0):T=STRIG(0):REM - get stick and trigger values›4220 IF T=0 AND S=15 THEN GOSUB 4500:GOTO 4210:REM - take a guess (trigger was hit)›4230 IF S<>15 THEN GOSUB 4300:GOTO 4210:REM - move Seeker›4240 GOTO 4210:REM - nothing happened›4300 REM - move Seeker›4305 POKE 77,0:REM - prevent ATTRACT MODE›4310 XD=XS(S):YD=YS(S):REM - direction based on joystick value›4320 LOCATE XSK+XD,YSK+YD,G:REM - find out what's ahead of the Seeker›4330 IF G=WALL THEN RETURN :REM - can not move through a wall!›4340 SOUND 0,XSK+YSK,8,4›4350 COLOR UNDER:PLOT XSK,YSK:REM - erase Seeker›4360 XSK=XSK+XD:YSK=YSK+YD:REM - move Seeker›4370 COLOR SEEKER:PLOT XSK,YSK:REM - draw Seeker›4380 UNDER=G:REM - new "underneath" value›4390 SOUND 0,0,0,0›4400 RETURN ›4500 REM - take a guess›4502 GUESSES=GUESSES+1›4505 IF XSK=XTRS AND YSK=YTRS THEN POP :RETURN :REM - win!›4510 FOR V=8 TO 0 STEP -0.5:SOUND 0,10,4,V:SETCOLOR 2,0,V:NEXT V:REM - special effects›4520 IF UNDER<>GRID THEN 4700:REM - show the same old clue that's in that spot›4530 DIST=INT(SQR((XTRS-XSK)^2+(YTRS-YSK)^2)+0.5)›4540 IF DIST>9 OR RND(1)<0.3 THEN 4600:REM - if too far, use an arrow clue›4550 UNDER=DIST+NUMBER:REM - number clue›4560 GOTO 4700›4600 XD=SGN(XTRS-XSK):YD=SGN(YTRS-YSK):REM - direction toward treasure from Seeker›4610 Z=3*(XD+1)+(YD+1):REM - compute proper arrow number›4620 UNDER=ARROW(Z):REM - use that arrow›4700 SOUND 0,20,10,8:COLOR UNDER:PLOT XSK,YSK:SOUND 0,0,0,0:REM - show clue›4710 RETURN ›5000 REM - Åîä›5100 TIME=(PEEK(20)+256*PEEK(19))/60:REM - find jiffies and divide by 60 to get seconds.›5110 GRAPHICS 0›5120 ? :? "You did it in ";TIME;" seconds"›5125 ? "(and in ";GUESSES;" guesses)."›5130 IF TIME<15 THEN ? :FOR F=100 TO 10 STEP -10:SOUND 0,F,10,4:? "Congratulations!":NEXT F:SOUND 0,0,0,0›5140 ? :? "Hit ÓÔÁÒÔ to play again,"›5150 ? "anything else to stop...";›5160 POKE 764,255:REM - clear keyboard value›5170 IF PEEK(764)<>255 OR PEEK(53279)<6 THEN PLAYAGAIN=0:? :POKE 764,255:RETURN :REM - they've had enough›5180 IF PEEK(53279)=6 THEN PLAYAGAIN=1:RETURN :REM - more!›5200 GOTO 5170›