1 rem Add Splash music 10 rem EvadeGame 20 cls 30 cursor 0 40 goto 9000 99 cls 100 rem set up variables 110 let a = 30 120 let b = 2 129 rem second ship 130 let c = a 140 let d = b 150 let e = 0 160 let f = 0 165 rem g is misses and h is hits 170 let g = 0 180 let h = 0 182 let i = 0 183 let j = 0 184 let k = 0 185 k = k - 10 186 let l = 0 187 let p = 40 188 let s = 100 190 let r = 0 200 let z = 0 210 let q = 0 220 let y = 0 230 let x = 0 240 let w = 0 250 let t = 0 260 let u = 0 499 rem Draw the screen 500 gosub 5100 510 gosub 6000 2999 rem Main loop of the program 3000 gosub 5100 3001 color 2,0 3002 gosub 10900 3005 l = kin 0 3010 if l = 113 then goto 6300 3020 if l = 28 then gosub 7200 3030 if l = 29 then gosub 7300 3040 if l = 30 then gosub 7400 3050 if l = 31 then gosub 7500 3060 if l = 32 then gosub 5500 3100 gosub 6100 3300 y = y + 1 3310 if y = 100 then y = 0 3320 if y = 0 then gosub 6400 3330 t = t + 1 3340 if t = 40 then t = 0 3350 if t = 0 then gosub 6600 3999 goto 3000 5099 rem Draw HUD 5100 color 15,0 5103 setxy 10,3 5104 print " _____________ " 5105 setxy 10,4 5110 print " /\ /\ " 5120 setxy 10,5 5130 print " / \ / \ " 5140 setxy 10,6 5150 print "/ \ / \" 5160 setxy 10,7 5170 print "| \ / |" 5180 setxy 10,8 5190 print "| \ / |" 5200 setxy 10,9 5210 print "| \ / |" 5220 setxy 10,10 5230 print "-------- --------" 5240 setxy 10,11 5250 print "| / \ |" 5260 setxy 10,12 5270 print "| / \ |" 5280 setxy 10,13 5290 print "| / \ |" 5300 setxy 10,14 5310 print "\ / \ /" 5320 setxy 10,15 5330 print " \ / \ / " 5340 setxy 10,16 5350 print " \/___________\/ " 5360 return 5499 rem fire button pressed 5500 if x < 4 then return 5505 color 2,0 5510 setxy 13,5 5520 print " \ / " 5530 setxy 13,15 5540 print " / \ " 5550 setxy 13,10 5560 chr 45 5570 setxy 25,10 5580 chr 45 5584 tune 78,0,0,25 5585 wait p 5590 setxy 13,6 5600 print " \ / " 5610 setxy 13,14 5620 print " / \ " 5630 setxy 14,10 5640 chr 45 5650 setxy 24,10 5660 chr 45 5564 tune 76,0,0,25 5665 wait p 5670 setxy 13,7 5680 print " \ / " 5690 setxy 13,13 5700 print " / \ " 5710 setxy 15,10 5720 chr 45 5730 setxy 23,10 5740 chr 45 5744 tune 74,0,0,25 5745 wait p 5750 setxy 13,8 5760 print " \ / " 5770 setxy 13,12 5780 print " / \ " 5790 setxy 16,10 5800 chr 45 5810 setxy 22,10 5820 chr 45 5824 tune 72,0,0,25 5825 wait p 5830 setxy 13,9 5840 print " \ / " 5850 setxy 13,11 5860 print " / \ " 5870 setxy 17,10 5880 chr 45 5890 setxy 21,10 5900 chr 45 5904 tune 70,0,0,25 5905 wait p 5910 gosub 6800 5915 rem setxy 19,10 5920 rem chr 42 5930 gosub 6000 5940 y = 1 5950 x = 0 5960 led 1,0 5990 return 5999 rem draw ion canon power 6000 setxy 35,0 6010 color 2,0 6020 chr 176 6030 chr 176 6040 chr 176 6050 chr 176 6060 chr 176 6070 return 6099 rem redraw the power of the ion canon 6100 color 2,0 6110 setxy 35,0 6120 for w = 0 to x 6130 chr 219 6140 next w 6290 return 6299 rem quit 6300 cls 6304 color 4,0 6306 setxy 6,3 6310 chr 218 6314 for i = 0 to 23 6316 chr 196 6320 next i 6324 chr 191 6326 setxy 6,4 6330 chr 179 6334 color 3,0 6336 print " Thank you for playing. " 6340 color 4,0 6344 chr 179 6346 setxy 6,5 6350 chr 192 6354 for i = 0 to 23 6356 chr 196 6360 next i 6364 chr 217 6366 setxy 0,8 6370 color 15,0 6375 print " Misses: " 6376 println g 6380 print " Kills: " 6385 println h 6390 setxy 0, 12 6392 led 0,0 6393 led 1,0 6394 led 2,0 6395 cursor 1 6396 end 6399 rem update the ion canon power bar 6400 if x = 4 then return 6405 if x = 2 then led 0,0 6410 setxy 35,0 6405 color 2,0 6420 for w = 0 to x 6430 chr 219 6440 next w 6445 x = x + 1 6446 if x = 4 then led 1,1 6450 return 6599 rem Move the enemy ship around randomly 6600 u = rnd 7 6610 if u = 0 then gosub 7600 6620 if u = 1 then gosub 7700 6630 if u = 2 then gosub 7800 6640 if u = 3 then gosub 7900 6650 if u = 4 then gosub 8000 6660 if u = 5 then gosub 8100 6670 if u = 6 then gosub 8200 6680 if u = 7 then gosub 8300 6690 gosub 6100 6790 return 6799 rem check for a hit on the ship 6800 if a < 19 then g = g + 1 6803 if a < 19 then return 6804 if a > 19 then g = g + 1 6805 if a > 19 then return 6807 if b < 10 then g = g + 1 6810 if b < 10 then return 6812 if b > 10 then g = g + 1 6815 if b > 10 then return 6890 h = h + 1 6899 rem Blow up the ship 6900 color 4,0 6905 led 0,1 6910 setxy 19,10 6920 chr 42 6930 wait s 6940 setxy 19,9 6950 chr 176 6960 setxy 18,10 6970 chr 176 6975 chr 42 6980 chr 176 6985 setxy 19,11 6990 chr 176 6995 wait s 7000 setxy 18,9 7010 print"***" 7020 setxy 18,10 7030 print "* *" 7040 setxy 18,11 7050 print "***" 7060 wait s 7070 setxy 18,9 7075 print "* *" 7080 setxy 18,10 7085 print " " 7090 setxy 18,11 7095 print "* *" 7100 tune 30,31,32,75 7105 led 0,0 7120 a = rnd 59 7125 if a > 9 then a = a - 10 7130 b = rnd 39 7135 if b > 9 then b = b - 10 7180 return 7199 rem turn the view to the left 7200 setxy a,b 7205 color 2,0 7210 chr 32 7220 b = b + 1 7225 if b > 29 then b = k 7230 gosub 10900 7250 return 7299 rem turn the view to the right 7300 setxy a,b 7305 color 2,0 7310 chr 32 7320 b = b - 1 7325 if b < k then b = 29 7330 gosub 10900 7350 return 7399 rem turn the view upward 7400 setxy a,b 7405 color 2,0 7410 chr 32 7420 a = a + 1 7425 if a > 49 then a = k 7430 gosub 10900 7450 return 7499 rem turn the view downward 7500 setxy a,b 7505 color 2,0 7510 chr 32 7520 a = a - 1 7525 if a < k then a = 49 7530 gosub 10900 7550 return 7600 color 2,0 7610 setxy a,b 7620 chr 32 7630 a = a - 1 7635 if a < k then a = 49 7640 b = b - 1 7645 if b < k then b = 29 7650 gosub 10900 7690 return 7700 color 2,0 7710 setxy a,b 7720 chr 32 7730 b = b - 1 7735 if b < k then b = 29 7740 gosub 10900 7780 return 7800 color 2,0 7810 setxy a,b 7820 chr 32 7830 a = a + 1 7835 if a > 49 then a = k 7840 b = b - 1 7845 if b < k then b = 29 7845 gosub 10900 7890 return 7900 color 2,0 7910 setxy a,b 7920 chr 32 7930 a = a - 1 7935 if a < k then a = 49 7940 gosub 10900 7980 return 8000 color 2,0 8005 setxy a,b 8010 chr 32 8020 a = a + 1 8025 if a > 49 then a = k 8030 gosub 10900 8070 return 8100 color 2,0 8105 setxy a,b 8110 chr 32 8120 a = a - 1 8125 if a < k then a = 49 8130 b = b + 1 8135 if b > 29 then b = k 8140 gosub 10900 8180 return 8200 color 2,0 8205 setxy a,b 8210 chr 32 8220 b = b + 1 8225 if b > 29 then b = k 8230 gosub 10900 8270 return 8300 color 2,0 8305 setxy a,b 8310 chr 32 8320 a = a + 1 8325 if a > 49 then a = k 8330 b = b + 1 8335 if b > 29 then b = k 8340 gosub 10900 8380 return 9000 rem this is the splash screen 9010 cls 9020 color 1,0 9030 for j = 0 to 19 9036 setxy 3,j 9040 for k = 0 to 4 9050 chr 176 9060 next k 9080 setxy 8,j 9090 for k = 0 to 4 9100 chr 177 9110 next k 9130 for k = 0 to 4 9140 chr 178 9150 next k 9170 for k = 0 to 4 9180 chr 219 9190 next k 9200 for k = 0 to 4 9210 chr 178 9220 next k 9230 for k = 0 to 4 9240 chr 177 9250 next k 9260 for k = 0 to 4 9270 chr 176 9280 next k 9290 next j 9295 color 3,1 9300 setxy 1,1 9310 chr 201 9320 for i = 1 to 37 9330 chr 205 9330 next i 9333 chr 187 9335 for i = 2 to 10 9340 setxy 1,i 9350 chr 186 9360 setxy 39,i 9370 chr 186 9380 next i 9390 setxy 1,11 9400 chr 200 9410 for i = 1 to 37 9420 chr 205 9430 next i 9440 chr 188 9490 color 14,1 9495 rem E 9500 setxy 6,3 9510 chr 201 9520 chr 205 9530 chr 205 9540 chr 205 9550 setxy 6,4 9560 chr 186 9570 setxy 6,5 9580 chr 204 9585 chr 205 9590 setxy 6,6 9600 chr 186 9602 setxy 6,7 9603 chr 186 9610 setxy 6,8 9620 chr 186 9630 setxy 6,9 9640 chr 200 9650 chr 205 9660 chr 205 9670 chr 205 9680 chr 205 9685 rem v 9690 setxy 12,5 9700 chr 186 9710 setxy 16,5 9720 chr 186 9730 setxy 12,6 9740 chr 186 9750 setxy 16,6 9760 chr 186 9770 setxy 12,7 9780 chr 200 9785 chr 187 9790 setxy 15,7 9800 chr 201 9805 chr 188 9810 setxy 13,8 9820 chr 200 9830 chr 203 9840 chr 188 9850 setxy 14,9 9860 chr 186 9865 rem a 9870 setxy 19,5 9880 chr 205 9890 chr 205 9900 chr 205 9910 chr 187 9920 setxy 22,6 9930 chr 186 9940 setxy 18,7 9950 chr 201 9960 chr 205 9970 chr 205 9975 chr 205 9980 chr 185 9990 setxy 18,8 10000 chr 186 10010 setxy 22,8 10020 chr 186 10030 setxy 18,9 10040 chr 200 10050 chr 205 10060 chr 205 10070 chr 205 10080 chr 188 10085 rem d 10090 setxy 28,3 10100 chr 186 10110 setxy 28,4 10120 chr 186 10130 setxy 28,5 10140 chr 186 10150 setxy 24,6 10160 chr 201 10170 chr 205 10180 chr 205 10190 chr 205 10200 chr 185 10210 setxy 24,7 10220 chr 186 10230 setxy 28,7 10240 chr 186 10242 setxy 24,8 10243 chr 186 10244 setxy 28,8 10245 chr 186 10250 setxy 24,9 10260 chr 200 10270 chr 205 10280 chr 205 10290 chr 205 10300 chr 188 10310 rem e 10320 setxy 30,5 10330 chr 201 10340 chr 205 10350 chr 205 10360 chr 205 10370 chr 187 10380 setxy 30,6 10390 chr 186 10400 setxy 34,6 10410 chr 186 10420 setxy 30,7 10430 chr 204 10440 chr 205 10450 chr 205 10460 chr 205 10470 chr 188 10480 setxy 30,8 10490 chr 186 10500 setxy 30,9 10510 chr 200 10520 chr 205 10530 chr 205 10540 chr 205 10550 chr 205 10580 color 14,1 10590 setxy 11,19 10595 print "<< Press space >>" 10600 i = kin 0 10610 if i = 32 then goto 10700 10620 goto 10600 10700 cls 10710 color 15,0 10715 println " " 10720 println "EVADE" 10730 println " " 10740 setxy 0,10 10750 println "The enemy ship is the little green dot" 10760 println "Use the arrow keys to aim your ship" 10770 println "Press the space button to fire" 10780 println "Press q to Quit the game " 10790 println " " 10800 println "Scores will be shown on the exit screen" 10810 println "Enjoy yourself." 10812 println " " 10815 println "Press space to start the game." 10820 c = kin 0 10830 if c = 32 then goto 99 10850 goto 10820 10898 rem Check where the ship is and display it 10899 rem This will get rid of a lot of repeated lines 10900 j = 249 10905 if a < 0 then j = 60 10906 if a < 0 then color 14,0 10910 if a > 39 then j = 62 10915 if a > 39 then color 14,0 10920 if b < 0 then j = 94 10925 if b < 0 then color 14,0 10930 if b > 19 then j = 118 10935 if b > 19 then color 14,0 10940 setxy a,b 10950 chr j 10960 return