home *** CD-ROM | disk | FTP | other *** search
- 1 rem --------------------------------- grade 12 computer science project
- 2 rem spiders by ian phillips
- 3 rem ---------------------------------
- 4 rem :
- 5 gosub6000
- 6 rem ---------------------------------
- 7 rem redefining characters ---------------------------------
- 8 rem :
- 10 poke53272,(peek(53272)and240)+12:poke52,48:poke56,48:clr
- 20 poke56334,peek(56334)and254:poke1,peek(1)and251:fori=0to511
- 30 pokei+12288,peek(i+53248):next:poke1,peek(1)or4:poke56334,peek(56334)or1
- 40 : fori=13128to13135:reada:pokei,a:next
- 50 : fori=13040to13047:reada:pokei,a:next
- 60 : fori=13304to13311:reada:pokei,a:next
- 70 : fori=12536to12543:reada:pokei,a:next
- 71 : fori=13104to13111:reada:pokei,a:next
- 72 : fori=13008to13015:reada:pokei,a:next
- 73 : fori=13048to13055:reada:pokei,a:next
- 74 : fori=12936to12943:reada:pokei,a:next
- 78 :
- 80 data 153,219,126,60,231,60,102,219,24,189,66,126,255,231,231,195,24,126,255
- 81 data 0,255,255,255,255,60,102,231,231,102,60,24,60,255,255,255,255,255,255
- 82 data 255,255,0,0,0,120,120,0,0,0,126,199,254,220,140,134,195,126,28,62,255
- 83 data 255,126,62,28,8
- 85 print"[145] "
- 86 print"[145] press return to play "
- 87 getg$:ifg$<>chr$(13)then85
- 88 rem --------------------------------
- 89 rem set up game, counters etc... --------------------------------
- 90 rem :
- 91 c=5:poke53281,0:poke53280,11:forl=54272to54296:pokel,0:next:poke54296,15
- 92 poke54271,128:poke54284,64:poke54291,128:poke54278,128:poke54285,248
- 93 tv=8:tw=8:b=0:cf=0:print"[147]":poke54292,64:sc=0
- 100 rem -------------------------------
- 101 rem game board set up -------------------------------
- 102 rem :
- 105 print"[129] [166][166][166][166][166][166][166][166][166][166][166][166][166][166][166][166][166][166][166][166][166][166][166][166][166][166][166][166][166][166][166][166][166][166][166][166][166][166]
- 106 [153]" spc((NULL)(NULL)(NULL)(NULL)(NULL)(NULL)(NULL)(NULL)(NULL)(NULL)(NULL)(NULL)(NULL)(NULL)(NULL)spc((NULL)(NULL)(NULL)(NULL)spc((NULL)(NULL)(NULL)(NULL)(NULL)(NULL)(NULL)(NULL)(NULL)(NULL)(NULL)(NULL)(NULL)(NULL)(NULL)spc(
- 107 print" [166][218][166][166][166][166][166][166][218][166][166][166][166][166][166][218][166][218][166][166][218][166][218][166][166][166][166][166][166][218][166][166][166][166][166][166][218][166]
- 108 [153]" spc((NULL)spc((NULL)(NULL)(NULL)(NULL)spc((NULL)(NULL)(NULL)spc(spc((NULL)(NULL)(NULL)spc((NULL)spc(spc((NULL)spc((NULL)(NULL)(NULL)spc(spc((NULL)(NULL)(NULL)spc((NULL)(NULL)(NULL)(NULL)spc((NULL)spc(
- 109 print" [166][218][218][218][166][166][218][166][218][166][218][166][166][218][166][218][166][218][166][166][218][166][218][166][218][166][166][218][166][218][166][218][166][166][218][218][218][166]
- 110 [153]" spc((NULL)spc((NULL)spc(spc((NULL)(NULL)(NULL)(NULL)(NULL)(NULL)(NULL)(NULL)spc((NULL)spc((NULL)spc(spc((NULL)spc((NULL)spc((NULL)(NULL)(NULL)(NULL)(NULL)(NULL)(NULL)(NULL)spc(spc((NULL)spc((NULL)spc(
- 111 print" [166][218][166][218][166][166][218][166][218][166][166][166][166][166][166][218][166][218][166][166][218][166][218][166][166][166][166][166][166][218][166][218][166][166][218][166][218][166]
- 112 [153]" spc((NULL)spc((NULL)(NULL)(NULL)(NULL)spc((NULL)spc((NULL)(NULL)(NULL)(NULL)(NULL)(NULL)(NULL)(NULL)(NULL)(NULL)(NULL)(NULL)(NULL)(NULL)(NULL)(NULL)(NULL)(NULL)spc((NULL)spc((NULL)(NULL)(NULL)(NULL)spc((NULL)spc(
- 113 print" [166][218][166][166][218][166][166][166][218][166][218][166][166][218][166][218][166][218][166][166][218][166][218][166][218][166][166][218][166][218][166][166][166][218][166][166][218][166]
- 114 [153]" spc((NULL)(NULL)(NULL)(NULL)(NULL)(NULL)(NULL)(NULL)spc((NULL)spc(spc((NULL)spc((NULL)spc((NULL)spc(spc((NULL)spc((NULL)spc((NULL)spc(spc((NULL)spc((NULL)(NULL)(NULL)(NULL)(NULL)(NULL)(NULL)(NULL)spc(
- 115 print" [166][218][166][166][166][166][166][166][218][166][218][166][166][218][166][218][166][218][166][166][218][166][218][166][218][166][166][218][166][218][166][166][166][166][166][166][218][166][166]";
- 116 print"[166][166][218][166][218][218][218][218][166][218][166][218][218][218][218][166][218][166][218][218][218][218][166][218][166][218][218][218][218][166][218][166][218][218][218][218][166][218][218][218]";
- 117 print"[218][218][218][166][218][166][166][218][218][218][218][218][166][166][218][218][218][166][218][166][166][218][166][218][218][218][166][166][218][218][218][218][218][166][166][218][166][218][166][166]";
- 118 print"[166][166][218][166][218][166][166][218][166][218][166][218][218][218][218][166][218][218][218][166][166][218][218][218][166][218][218][218][218][166][218][166][218][166][166][218][166][218][166]
- 119 [153]" spc((NULL)spc((NULL)spc(spc((NULL)spc((NULL)spc(spc(spc(spc(spc(spc((NULL)spc((NULL)(NULL)(NULL)(NULL)spc((NULL)spc(spc(spc(spc(spc(spc((NULL)spc((NULL)spc(spc((NULL)spc((NULL)spc(
- 120 print" [166][218][218][218][166][166][218][218][218][166][218][218][218][218][166][218][166][166][166][166][166][166][218][166][218][218][218][218][166][218][218][218][166][166][218][218][218][166]
- 121 [153]" spc((NULL)spc((NULL)spc(spc((NULL)spc((NULL)spc((NULL)spc(spc((NULL)spc((NULL)spc((NULL)(NULL)(NULL)(NULL)spc((NULL)spc((NULL)spc(spc((NULL)spc((NULL)spc((NULL)spc(spc((NULL)spc((NULL)spc(
- 122 print" [166][218][166][218][166][166][218][166][218][166][218][166][166][218][166][218][166][218][166][166][218][166][218][166][218][166][166][218][166][218][166][218][166][166][218][166][218][166]
- 123 [153]" spc((NULL)spc((NULL)spc(spc((NULL)spc((NULL)(NULL)(NULL)spc(spc((NULL)(NULL)(NULL)spc((NULL)spc(spc((NULL)spc((NULL)(NULL)(NULL)spc(spc((NULL)(NULL)(NULL)spc((NULL)spc(spc((NULL)spc((NULL)spc(
- 124 print" [166][218][166][218][218][218][218][166][218][166][218][166][166][218][166][218][166][218][218][218][218][166][218][166][218][166][166][218][166][218][166][218][218][218][218][166][218][166]
- 125 [153]" spc((NULL)spc(spc(spc(spc((NULL)spc((NULL)spc((NULL)spc(spc((NULL)(NULL)(NULL)(NULL)(NULL)spc(spc((NULL)(NULL)(NULL)(NULL)(NULL)spc(spc((NULL)spc((NULL)spc((NULL)spc(spc(spc(spc((NULL)spc(
- 126 print" [166][218][218][218][218][218][218][218][218][218][218][166][166][166][166][166][166][166][166][166][166][166][166][166][166][166][166][218][218][218][218][218][218][218][218][218][218][166]
- 127 [153]" spc(spc(spc(spc(spc(spc(spc(spc(spc(spc(spc(spc(spc(spc(spc(spc(spc(spc(spc(spc(spc(spc(spc(spc(spc(spc(spc(spc(spc(spc(spc(spc(spc(spc(spc(spc(spc(spc(
- 128 :
- 130 rem **** place game characters **** :
- 135 ifc>30thenc=30
- 140 : forl=1to(2*c)
- 150 x=int(1000*rnd(1))+1024:ifpeek(x)<>90then150
- 160 pokex,127:pokex+54272,7:next:forl=1toc
- 170 x=int(1000*rnd(1))+1024:ifpeek(x)<>90then170
- 180 pokex,31:pokex+54272,4:next:forl=1toc
- 190 fly=int(1000*rnd(1))+1024:ifpeek(fly)=90thenpokefly,94:pokefly+54272,1
- 195 ifpeek(fly)<>94thengoto190
- 200 spi=int(1000*rnd(1))+1024:ifpeek(spi)=90thenpokespi,105:pokespi+54272,1
- 205 ho=spi:ifpeek(spi)<>105thengoto200
- 210 mc=int(1000*rnd(1))+1024:ifpeek(mc)<>90then210
- 220 pokemc,127:pokemc+54272,7
- 240 :
- 250 rem ******* set timer ************* :
- 260 me=ti
- 290 :
- 500 rem -------------------------------
- 501 rem movement of spider -------------------------------
- 502 rem :
- 505 ifcf=1thenfly=spi
- 506 pokeho+54272,1:pokeho,8:poke54272+fly,1
- 510 getg$:poke56322,0:j=peek(56320):t=jand16:j=15-(jand15):poke56322,255
- 511 ifcm=3thengosub1000
- 512 ifcf<>0thenff=0:goto514
- 513 ifff=40thengosub1000
- 514 ff=ff+1:cm=cm+1:ifcf=1thensc=sc-1
- 515 ifg$=" "then7000
- 516 print"score:"sc"[157] [166][166][166][166][166][166][166]"
- 520 ifj=1thenmove=-40:goto530
- 521 ifj=2thenmove=+40:goto530
- 522 ifj=4thenmove=-1:goto530
- 523 ifj=8thenmove=+1:goto530
- 524 ift=16thenpokeho+54272,0:pokefly+54272,0:goto505
- 525 goto580
- 530 ifpeek((spi+move))=8then5000
- 531 ifpeek((spi+move))<>90then600
- 540 pokespi,90:pokespi+54272,0:spi=spi+move:pokespi,105:pokespi+54272,1:sc=sc+1
- 550 goto510
- 560 :
- 580 ifpeek(spi+move)=127then582
- 581 ifpeek(spi+move)<>31then510
- 582 : forl=1to100step10:pokespi+move,109:pokespi+move,123:sc=sc+5:poke54273,l
- 583 poke54272,l+10:poke54276,129:next:poke54276,0:pokespi,90:pokespi+54272,0
- 584 spi=spi+move:pokespi,105:pokespi+54272,1:goto510
- 590 :
- 600 rem -------------------------------
- 601 rem check obstructions -------------------------------
- 602 rem :
- 610 ifpeek(spi+move)<>127then630
- 615 : forl=50to250step5:pokespi,95:poke54273,l:poke54272,l+5:poke54276,129
- 620 pokespi+54272,1:pokespi,81:next:poke54276,0
- 625 goto7000
- 629 :
- 630 ifpeek(spi+move)<>31then650
- 635 : forl=1to3:poke54273,255:poke54272,254:poke54276,17:poke54280,12
- 640 poke54279,10:poke54283,33:pokespi+54272,l:next:poke54276,0:poke54283,0
- 645 goto7000
- 649 :
- 650 ifpeek(spi+move)<>94then699
- 655 cf=1:forn=10to100step10:poke54273,n:poke54272,n-1:poke54276,17:next
- 656 sc=sc+1000
- 660 pokespi,90:pokespi+54272,0:spi=spi+move:pokespi,105:poke54276,0:goto510
- 698 :
- 699 goto510
- 1000 rem ------------------------------
- 1001 rem relocate fly and spray cans ------------------------------
- 1002 rem :
- 1010 ifcm<>3then1400
- 1011 pokemc,90:pokemc+54272,tv
- 1012 mc=int(1000*rnd(1))+1024:ifpeek(mc)<>90then1012
- 1013 tv=peek(mc+54272):pokemc,127:pokemc+54272,7:cm=0
- 1400 ifcf=1then4000
- 1410 :
- 1500 ifff<>40then4000
- 1510 pokefly,90:pokefly+54272,tw
- 1512 fly=int(1000*rnd(1))+1024:ifpeek(fly)<>90then1512
- 1513 tw=peek(fly+54272):pokefly,94:pokefly+54272,1:ff=0
- 4000 return
- 5000 rem ------------------------------
- 5001 rem spider back at home bace ------------------------------
- 5002 rem :
- 5003 rem **** is fly with spider ? **** :
- 5010 ifcf=0then540
- 5011 me=ti-me:ifme<10000thenb=b+5
- 5015 sc=sc+1000
- 5016 : forn=100to10step-10:poke54273,n:poke54272,n-1:poke54276,17
- 5020 poke53280,1:poke53280,251:poke53281,1:poke53281,240:next:c=c+5:cf=0
- 5030 poke54276,0:goto100
- 5060 :
- 6000 rem ------------------------------
- 6001 rem instructions ------------------------------
- 6002 rem :
- 6010 poke53281,1:poke53280,1
- 6020 print"[147][144][166][166][166][166][166][166][166][166][166][166][166][166][166][166][166][166][166][166][166][166][166][166][166][166][166][166][166][166][166][166][166][166][166][166][166][166][166][166][166][166]";
- 6030 forl=1to20:print"[166] [166]";:next
- 6040 print"[166][166][166][166][166][166][166][166][166][166][166][166][166][166][166][166][166][166][166][166][166][166][166][166][166][166][166][166][166][166][166][166][166][166][166][166][166][166][166][166]"
- 6050 print""
- 6060 print" spiders - instructions
- 6062 [153]"start at the 'h' and catch the fly((NULL))."
- 6063 [153]"watch out for raid (sin) & for bugs (_)."
- 6064 [153]"eliminate them with fire button."
- 6065 [153]"use control port #2 for your joystick."
- 6066 [153]"space bar ends game automatically."
- 6067 [153]"any number of rounds can be played."
- 6068 [153]"a new round starts when fly is brought"
- 6069 [153]"home-'h'. game ends if sprayed or "
- 6070 [153]"caught by bug. the faster the better!"
- 6075 [153]" re-defining characters"
- 6080 :
- 6999 [142]
- 7000 [143] ------------------------------
- 7001 [143] end of game ------------------------------
- 7002 [143] :
- 7010 [153]"load"
- 7400 : [129]l[178]1[164]b:sc[178]sc[170]217:[153]"score:"sc:[129]g[178]1[164]50:[130]g,l
- 7425 [139]sc[177]hs[167]hs[178]sc:hs[178]hs[171]217
- 7426 sc[178]sc[171]217:[153]"score:"sc"cmd "
- 7450 [153]"high score:"hs
- 7500 [153]"play again? (y/n)"
- 7510 [161]g$:[139]g$[178]"y"[167]90
- 7520 [139]g$[179][177]"n"[167]7510
- 7530 [153]"loadstop":[151]53280,1:[151]53281,1:[137]63000:[128] [175] hook back [164] pay[147]
- 8000 [143] ------------------------------
- 8001 [143] dictionary ------------------------------
- 8002 :
- 8010 [143] c = number of obstructions
- 8011 [143] fly = fly's location
- 8012 [143] spi = spiders's location
- 8013 [143] ho = spiders's home
- 8014 [143] cf = indicates weather or not
- 8015 [143] the spider has the fly
- 8016 [143] mc = location of moving can
- 8017 [143] cm = counter for moving can
- 8018 [143] ff = counter for moving fly
- 8019 [143] sc = score
- 8020 [143] hs = high score
- 8021 [143] x = random numbers
- 8022 [143] j = joystick control
- 8023 [143] t = joystick control
- 8024 [143] me = timer
- 8025 [143] b = bonus score (for speed)
- 8026 [143] ------------------------------
- 63000 [140]:[151]53272,21:[151]56,160
- 63005 [153]"loadload"[199](34)"payload"[199](34)",8":[153]"run"
- 63010 [151]631,13:[151]632,13:[151]198,2:[128]
-