DECLARE SUB highscore (score!) ' Mine field game ' 1.2 - new keybord routine so its responds much faster (thanks to IDK!) ' timer control ' new beep timer ' 1.1 - fixed music bug and added highscore file ' made by Olle Bergkvist SCREEN 13 reboot: CLS xme = 5 yme = 100 LINE (0, 0)-(320, 0), 15: FOR n = 0 TO 2000000!: NEXT LINE (0, 199)-(320, 199), 15: FOR n = 0 TO 2000000!: NEXT LINE (0, 0)-(0, 200), 9: FOR n = 0 TO 2000000!: NEXT LINE (319, 0)-(319, 200), 12: FOR n = 0 TO 2000000!: NEXT LOCATE 3 PRINT "You have to cross a field with mines. One single accidently keypress, and youre dead." PRINT PRINT "Navigate with the numeric keyboard, or the arrow keys. Exit with Esc." PRINT "Press any key to start the game." LOCATE 22 PRINT "Made by Olle Bergkvist 1.2" LOCATE 5 PSET (xme, 199 - yme), 15 CIRCLE (xme, 199 - yme), 10 CIRCLE (xme, 199 - yme), 20 SLEEP LINE (0, 0)-(0, 200), 9 LINE (319, 0)-(319, 200), 12 LINE (1, 1)-(318, 198), 0, BF RANDOMIZE TIMER FOR n = 0 TO 999 a = 317 * RND + 1 b = 197 * RND + 1 LINE (a, b)-(a + 1, b + 1), 9, BF NEXT n start = TIMER playat = start '-----------------------Start DO keyn = INP(96) xmov = 0 ymov = 0 SELECT CASE keyn CASE 1 END CASE 71, 72, 73 ymov = 1 CASE 79, 80, 81 ymov = -1 END SELECT SELECT CASE keyn CASE 79, 75, 71 xmov = -1 CASE 81, 77, 73 xmov = 1 END SELECT '/////////////////////////// IF xmov OR ymov THEN PRESET (xme, 199 - yme) xme = xme + xmov yme = yme + ymov IF xme > 318 THEN score = TIMER - start PRINT "You came out from the mine field alive!" PRINT "It took"; score; "seconds." highscore (score) PRINT "Press Esc to exit, or Space to play again." PLAY "l4 o2 c e g o3 l2 c" DO IF INKEY$ = CHR$(27) THEN END IF INKEY$ = " " THEN GOTO reboot LOOP END END IF IF POINT(xme, 199 - yme) THEN PRINT "You died!" PRINT "After"; xme; "of 320 pixels and "; TIMER - start; "seconds in the mine field." PRINT "Press Esc to exit, or Space to try again." SOUND 50, 30 DO IF INKEY$ = CHR$(27) THEN END IF INKEY$ = " " THEN GOTO reboot LOOP END IF END IF '\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ PSET (xme, 199 - yme), 15 t = TIMER IF t - playat > 1 THEN playat = t: SOUND 1000, .5 DO key$ = INKEY$ LOOP WHILE t + .01 > TIMER LOOP SUB highscore (score) OPEN "minegame.dat" FOR APPEND AS #1 PRINT #1, "0" CLOSE OPEN "minegame.dat" FOR INPUT AS #1 INPUT #1, high CLOSE PRINT "Highscore:"; high IF high = 0 OR high > score THEN high = score OPEN "minegame.dat" FOR OUTPUT AS #1 PRINT #1, high CLOSE END SUB