home *** CD-ROM | disk | FTP | other *** search
- 10 gosub 10000 : rem *variables*
- 20 gosub 9000 : rem *board*
- 99 rem * start *
- 100 sc$="welcome to galactic encounter: "
- 110 te=0:sl=11:z=866:gosub 3000
- 120 sc$="do you wish to setup y/n?":gosub 4010
- 130 if po=0 then 160
- 140 goto 6000
- 150 gosub 9010
- 160 p=0:te=0:z=866:sl=11
- 199 rem * main loop *
- 200 en=0:gosub 2000:gosub 2300
- 210 sc$="game on: "+br$(2+p)+". "
- 220 gosub 3000
- 230 sys cs,185+320*p,13,30,0
- 240 sys sr,5
- 250 sys sp,x,y,1
- 260 br=bo%(x,y):gosub 2500
- 270 gosub 3300
- 280 if f=0 then 310
- 290 if ed then 8400
- 300 gosub 4000: if po then mv(p)=1:mo=1:gosub 2200:goto 200
- 310 if s and ed then gosub 8100
- 320 if s and ed=0 then 400
- 330 y=y+d*(y<6)-u*(y>0)
- 340 x=x+r*(x<6)-l*(x>0)
- 350 goto 250
- 399 rem * check *
- 400 br=bo%(x,y)
- 410 if br>1+p*5 and br<7+p*5 then sys fx,0:goto 500
- 420 sys fx,1:sc$="you can't select that "+br$(2+p)+". "
- 430 gosub 3000:goto 260
- 499 rem * select *
- 500 sys se,p3
- 510 mo=0:gosub 3300
- 520 if br<>6 and br<>11 then 570
- 530 dy=u-d:dx=l-r
- 540 if dx+dy then u=1:goto 600
- 550 if f then d=1:goto 620
- 560 goto 640
- 570 dr=br-2-p*5
- 580 dx=(drand1)*(dr-2)
- 590 dy=((drand1)-1)*(1-dr)
- 600 if u then gosub 700:goto 650
- 610 if r+l then gosub 900:goto 650
- 620 if d then gosub 1000:goto 650
- 630 if f then sys at,z,"[144]de-select !":goto 510
- 640 if s then sys se,p3:goto 260
- 650 if mo then gosub 2200:if en=1 then 200
- 660 goto 510
- 699 rem * forward *
- 700 ax=x+dx:ay=y+dy
- 710 if ax<0 or ax>6 or ay<0 or ay>6 then s$="there ":goto 790
- 720 ar=bo%(ax,ay)
- 730 if ar>0 then s$="on to that square ":goto 790
- 740 mo=1
- 750 bo%(x,y)=0: sys ch,x,y,0
- 760 y=ay:x=ax: sys ch,x,y,br
- 770 bo%(x,y)=br:sys sp,x,y,0
- 780 return
- 790 sc$="you can't move "+s$+br$(2+p)+". "
- 800 sys fx,1:gosub 3000:return
- 899 rem * rotate *
- 900 br=((dr+r-l)and3)+2+5*p
- 910 bo%(x,y)=br:mo=1
- 920 sys ch,x,y,br
- 930 if peek(j1)<>127 then 930
- 940 return
- 999 rem * fire *
- 1000 sc$="cannons primed........fire: y/n?"
- 1010 gosub 4010: if po then 1030
- 1020 sys at,z," no firing ";:return
- 1030 if br<>6 and br<>11 then 1070
- 1040 sc$="direction ? move joystick. ":gosub 3000
- 1050 gosub 3300:if s+f then 1050
- 1060 dy=u-d:dx=l-r
- 1070 te=1:sc$="how many shots: ?":gosub 3000
- 1080 get k$:mo=val(k$):if mo<1 or mo>mv(p) then 1080
- 1090 for c1=1 to mo
- 1100 bx=x:by=y:te=0:m=0
- 1110 poke v+21,0
- 1120 bx=bx+dx:by=by+dy
- 1130 if bx<0orbx>6orby<0 or by>6 then r=0:bx=bx-(bx<0):by=by-(by<0):goto 1180
- 1140 ar=bo%(bx,by)
- 1150 if ar=0 or ar>11 then 1120
- 1160 r=0-(ar=1)-2*(ar>1 and ar<6)-3*(ar>6 and ar<11)-4*(ar=6)-5*(ar=11)
- 1170 q=0-(ar>6)
- 1180 sys bm,bx,by,1:if r<2 then 1250
- 1190 sys fx,3:if r<4 then 1230
- 1200 sys at,391+320*q+d(q)," "
- 1210 d(q)=d(q)-1
- 1220 if d(q)>0 then m=1:goto1250
- 1230 sys ex,bx,by,p2
- 1240 bo%(bx,by)=12
- 1250 sc$=sp$+r$(r)
- 1260 if r<2 then 1360
- 1270 if m then sc$=sc$+" hit!! ":goto 1360
- 1280 sc$=sc$+" destroyed!!! "
- 1290 s(q)=s(q)-1:poke 646,c(q)
- 1300 sys at,312+q*320,s(q);
- 1310 if s(q)>0 then 1360
- 1320 te=0:sc$="wow!!! "+br$(3-q)+" has won!!! ":gosub 3000
- 1330 sc$="how about another game y/n?"
- 1340 gosub 4010:if po then run
- 1350 sys 64738
- 1360 gosub 3000
- 1370 sys sp,x,y,0
- 1380 next c1
- 1390 poke v+21,1:return
- 1999 rem * debris *
- 2000 for y=0 to 6:for x=0 to 6
- 2010 br=bo%(x,y):if br<12 then 2040
- 2020 br=br+1:if br=18 then br=0
- 2030 bo%(x,y)=br
- 2040 next x,y:sys pb
- 2050 return
- 2199 rem * reduce turns *
- 2200 mv(p)=mv(p)-mo:gosub 2250
- 2210 if mv(p)>0 then return
- 2220 sc$="your turn has ended "+br$(2+p)+". ":te=0
- 2230 poke v+21,0:gosub 3000
- 2240 mv(p)=mv:en=1:p=1-p
- 2250 poke 646,c(p):sys at,272+p*320,mv(p);"[157] "
- 2260 return
- 2299 rem * find player *
- 2300 for y=0 to 6:for x=0 to 6
- 2310 br=bo%(x,y)
- 2320 if br>1+p*5 and br<7+p*5 then return
- 2330 next x,y
- 2499 rem * comments *
- 2500 dr=br:if br>1 and br<6 or br>6 and br<11 then dr=10+(br<7):goto 2530
- 2510 if br=6 or br=11 then dr=6+(br=6):goto 2530
- 2520 if br>11 then dr=7
- 2530 sys at,z,"[144]";br$(dr)
- 2540 return
- 2999 rem * scroll *
- 3000 print"[144]"
- 3010 if z=866 then sys cs,785,13,30,1
- 3020 sys 46374:sys sc,sc,z,sl,p1,te
- 3030 return
- 3299 rem * key/joy *
- 3300 get k$:j=peek(j1)
- 3310 if k$="" and j=127 then 3300
- 3320 u=j=up or k$=up$
- 3330 d=j=do or k$=do$
- 3340 l=j=le or k$=le$
- 3350 r=j=ri or k$=ri$
- 3360 s=j=fi or k$=fi$
- 3370 f=k$=" " or k$=chr$(13)
- 3380 if u+d+l+r+f+s=0 then 3300
- 3390 return
- 3999 rem * y/n? *
- 4000 sc$="finished ?"
- 4010 te=1:gosub 3000
- 4020 get k$:if k$=" " or k$=chr$(13) or k$="y" or peek(j1)=111 then po=1:return
- 4030 if k$<>"n" then 4020
- 4040 po=0:return
- 5999 rem * setup *
- 6000 sys wp
- 6010 sys at,z,sp$
- 6020 w=145:sys at,w,"[146][144]screen border"
- 6030 w=w+40:sys at,w,"scrn backgrnd"
- 6040 w=w+40:sys at,w,"board border "
- 6050 w=w+40:sys at,w,"board "
- 6060 w=w+40:sys at,w,"player 1 "
- 6070 w=w+40:sys at,w,"player 2 "
- 6080 w=w+40:sys at,w,"blackhole "
- 6090 w=w+40:sys at,w,"debris cloud "
- 6100 w=w+40:sys at,w,"moves: ";mv
- 6110 w=w+39:sys at,w,dh;"hits to zap"
- 6120 w=w+41:sys at,w," destroyer "
- 6130 w=w+40:sys at,w,"scroll speed "
- 6140 w=w+40:sys at,w,"redefine keys"
- 6150 w=w+40:sys at,w,"edit pieces "
- 6160 w=w+40:sys at,w,"load save def"
- 6200 li=14
- 6210 w=145+li*40
- 6220 sys rv,w,13:sys pu,w,13,20,0
- 6230 gosub 3300:if l+r then 6230
- 6240 if f then 6900
- 6250 if s then poke w+55296,2:sys cs,w,13,30,0:goto 6400
- 6260 o=li:o1=w
- 6270 li=li+d*(li<14)-u*(li>0)
- 6280 li=li+(d-u)*(li=10)
- 6290 if o=li then 6230
- 6300 sys rv,o1,13
- 6310 goto 6210
- 6400 on li goto 6440,6470,6500,6530,6540,6550,6560,6610,6640,,6670,8700,8000,7000
- 6410 sys at,z,co$(bd):va=bd
- 6420 gosub 6730:if f+s then 6800
- 6430 bd=va:poke 53280,bd:goto 6410
- 6440 sys at,z,co$(bk):va=bk
- 6450 gosub 6730:if f+s then 6800
- 6460 bk=va:poke 53281,bk:goto 6440
- 6470 sys at,z,co$(bb):va=bb
- 6480 gosub 6730:if f+s then 6800
- 6490 bb=va:sys b1,bb:goto 6470
- 6500 sys at,z,co$(bi):va=bi
- 6510 gosub 6730:if f+s then 6800
- 6520 bi=va:sys b2,bi:goto 6500
- 6530 c=0:goto 6570
- 6540 c=1:goto 6570
- 6550 c=2:goto 6570
- 6560 c=3
- 6570 sys at,z,"[144]";co$(c(c)):va=c(c)
- 6580 gosub 6730:if f+s then 6800
- 6590 c(c)=va:poke 704+c,c(c):sys pb
- 6600 goto 6570
- 6610 poke 30169,mv+176:va=mv:gosub 6730
- 6620 if f+s then mv(0)=mv:mv(1)=mv:goto 6800
- 6630 mv=va-(va<1)+(va>9):goto 6610
- 6640 poke 30201,dh+176:va=dh:gosub 6730
- 6650 if f+s then d(0)=dh:d(1)=dh:goto 6800
- 6660 dh=va-(va<1)+(va>5):goto 6640
- 6670 sc$=sp$(vi):p1=sp(vi)
- 6680 te=0:gosub 3000
- 6690 for c1=1 to 200:next
- 6700 sys at,z,sp$(vi);
- 6710 va=vi:gosub 6730:if f+s then 6800
- 6720 vi=va-(va<1)+(va>3):goto 6670
- 6730 gosub 3300:va=(va-d-r+l+u)and15
- 6740 return
- 6800 sys at,866,"[146]";sp$
- 6810 poke w+55296,0:sys cs,w,13,30,0
- 6820 goto 6230
- 6900 sys rv,w,13
- 6910 gosub 4000
- 6920 if po=1 then goto 150
- 6930 sys at,z,"continue..."
- 6940 goto 6210
- 7000 sc$="load, save, or default board: ":te=0:gosub 3000
- 7010 sc$="l,s,d, or n"
- 7020 sys at,z,"l,s,d, or n"
- 7030 get k$:if k$="" then 7030
- 7040 if k$="l" then 7200
- 7050 if k$="s" then 7500
- 7060 if k$="d" then 7600
- 7070 if k$="n" then 6000
- 7080 goto 7030
- 7200 gosub 7700:open 15,8,15,"i"
- 7205 open 2,8,2,pr$+"r"
- 7207 input#15,a,b$:if a<20 then 7210
- 7208 te=0:sc$=b$+"...try again":gosub 3000
- 7209 goto 7330
- 7210 for y=0 to 6:for x=0 to 6
- 7220 get#2,bo$:bo%(x,y)=asc(bo$+chr$(0))
- 7230 next x,y
- 7240 for c1=0 to 3:input#2,c(c1)
- 7250 poke 704+c1,c(c1):next c1
- 7260 input#2,bb,bk,bi,bd,p1
- 7270 input#2,up$,do$,le$,ri$,fi$
- 7280 input#2,mv,dh,s(0),s(1),m1,m2
- 7285 md=0:gosub 8600
- 7290 mv(0)=mv:mv(1)=mv:lo=0
- 7310 sys b1,bb:sys b2,bi
- 7320 sys pb:gosub 10400
- 7330 close 2:close 15:goto 6000
- 7500 gosub 7700:open 2,8,2,pr$+"w"
- 7510 for y=0 to 6:for x=0 to 6
- 7520 print#2,chr$(bo%(x,y));
- 7530 next x,y
- 7540 for c1=0 to 3:print#2,c(c1)
- 7550 next c1
- 7560 print#2,bb;z$;bk;z$;bi;z$;bd;z$;p1;z$;up$;z$;do$;z$;le$;z$;ri$;z$;fi$
- 7570 print#2,mv;z$;dh;z$;s(0);z$;s(1);z$;m1;z$;m2
- 7580 close 2
- 7590 goto 6000
- 7600 sys at,z,"please wait":clr
- 7610 gosub 10010:z=866:sl=11
- 7620 goto 7310
- 7700 sys at,z,"file (0-9):":z$=chr$(13)
- 7710 get k$:if k$<"0" or k$>"9" then 7710
- 7720 pr$="@0:ge.config "+k$+",s,"
- 7730 return
- 7999 rem * edit pieces *
- 8000 sys wp:x=3:y=3:ed=-1:te=1:sl=11
- 8010 sys at,106,"[146][164][164][164][164][164][164][164][164][164][164][164]"
- 8020 z=145:sys at,z,"( )";
- 8030 z=z+1:sc$="edit pieces":gosub 3020:sys pu,z-1,sl+2,60,1
- 8040 z=866:sl=11
- 8050 gosub 8530:goto 240
- 8100 if br then 8300
- 8110 br=1:ed=0:md=1:sys se,p3:sys fx,0
- 8120 sys at,z,"creating...";
- 8130 goto 8200
- 8140 gosub 3300:if f then 8140
- 8150 if s then 8210
- 8160 br=br+l-r
- 8170 br=br-(l-r)*((br=6 and m1)or(br=11 and m2))
- 8180 br=br-(l-r)*(br=13 or br=15)
- 8190 br=br-(br<1)+(br>16)
- 8200 sys ch,x,y,br:goto 8140
- 8210 sys se,p3:bo%(x,y)=br:ed=-1
- 8220 gosub 8600:gosub 8530
- 8230 return
- 8300 md=-1:gosub 8600:gosub 8530
- 8310 bo%(x,y)=0:sys ch,x,y,0
- 8320 return
- 8400 if s(0)>0 and s(1)>0 then 8500
- 8410 sc$="each player must have at least one ship!!! ":te=0:gosub 3000
- 8420 goto 270
- 8500 gosub 4000
- 8510 if po then sys si,5:ed=0:goto 6000
- 8520 goto 240
- 8530 sys at,265,"[144][146]ships pl.1: [157][157][157]";s(0)
- 8540 sys at,345,"ships pl.2: [157][157][157]";s(1)
- 8550 return
- 8600 s(0)=s(0)-(br>1 and br<7)*md
- 8610 s(1)=s(1)-(br>6 and br<12)*md
- 8620 m1=m1+(br=6)*md :d(0)=-m1*dh
- 8630 m2=m2+(br=11)*md:d(1)=-m2*dh
- 8640 return
- 8699 rem * keys *
- 8700 sys wp:sys at,z,sp$
- 8710 sys at,109,"[146][164][164][164][164]"
- 8720 z=148:sys at,z,"( )";
- 8730 z=z+1:sc$="keys":sl=4:te=1:gosub 3020:sys pu,z-1,sl+2,60,1
- 8740 z=866:sl=11
- 8750 w=265:sys at,w,"[146][144]up : ?[157]";
- 8760 gosub 8900:up$=k$
- 8770 w=w+80:sys at,w,"down/fire : ?[157]";
- 8780 gosub 8900:do$=k$
- 8790 w=w+80:sys at,w,"left : ?[157]";
- 8800 gosub 8900:le$=k$
- 8810 w=w+80:sys at,w,"right : ?[157]";
- 8820 gosub 8900:ri$=k$
- 8830 w=w+80:sys at,w,"select : ?[157]";
- 8840 gosub 8900:fi$=k$
- 8850 if up$=do$ or up$=le$ or up$=ri$ or up$=fi$ or do$=le$ then 8950
- 8860 if do$=ri$ or do$=fi$ or le$=ri$ or le$=fi$ or ri$=fi$ then 8950
- 8870 sc$="is this ok?":gosub 4000
- 8880 if po then 6000
- 8890 goto 8750
- 8900 poke 198,0
- 8910 get k$:if k$="" then 8910
- 8920 if asc(k$)>95 or asc(k$)<46 then 8900
- 8930 print k$:return
- 8950 sc$="*bad keys!*":te=1:gosub 3000
- 8960 for c1=0 to 3:sys pu,z,sl,40,0
- 8970 next c1
- 8980 sys at,z,"please redo":goto 8750
- 8999 rem *print board*
- 9000 print"[147]";:sys b1,bb:sys b2,bi
- 9010 sys wp:sys pb
- 9020 print"( )( )[146][152]"
- 9030 poke 646,c(0):sys at,225,c$
- 9040 poke 646,c(1):sys at,545,c$
- 9050 sys at,865,"[144]([146] )[146]"
- 9060 sys at,905," "+c$
- 9070 sys at,946,"[144]";m$
- 9080 sys at,785," "
- 9090 sys at,745,"[146][164][164][164][164][164][164][164][164][164][164][164][164][164]";
- 9100 z=48:sc$="the board":te=1:sl=10:gosub 3020:sys pu,z-1,sl+2,60,0
- 9110 z=66:sc$="the action":sl=11: gosub 3020:sys pu,z-1,sl+2,60,0
- 9120 print"";
- 9130 z=785:sc$="status report":sl=13:gosub 3020:sys pu,z,sl,60,1
- 9140 print"[146]";:p=0:poke 646,c(p)
- 9150 z=185:sc$=br$(2)+":":sl=11:gosub3020
- 9160 gosub 9200:p=1:poke 646,c(p)
- 9170 z=505:sc$=br$(3)+":":gosub 3020
- 9200 z=z+80:sys at,z,"turns: ";mv(p)
- 9210 z=z+40:sys at,z,"ships: ";s(p)
- 9220 if d(p)=0 then 9250
- 9230 z=z+40:sys at,z,br$(4)
- 9240 z=z+47:sys at,z,left$(br$(8),2*dh+1);"[146]"
- 9250 return
- 9999 rem * variables *
- 10000 poke 56,115:sys49155,5:print"[147]"
- 10010 dim bo%(6,6),sc$,sc,sl,br,z,x,y,j,j1,br$(10),mv(1),d(1),s(1),r$(5),c(3)
- 10020 dim at,mv,p,up,le,ri,do,fi,up$,do$,le$,ri$,fi$,u,l,d,r,s,f,v
- 10030 dim sp$,p1,p2,p3,dr,mo,c1,c2,c3,p,m$,c$,co$(15),sp$(3),sp(3)
- 10040 m1=0:m2=0:md=1
- 10050 for y=0 to 6:for x=0 to 6
- 10060 read br:bo%(x,y)=br
- 10070 gosub 8600
- 10080 next x,y
- 10090 read mv,dh,sp(1),sp(2),sp(3),p2,p3
- 10100 mv(0)=mv:mv(1)=mv
- 10110 d(0)=5:d(1)=5
- 10120 vi=1:p1=sp(vi)
- 10130 up=126:do=125:le=123:ri=119
- 10140 j1=56320:fi=111
- 10150 read up$,do$,le$,ri$,fi$
- 10160 sp$=" "
- 10170 m$= " [215][216] [209][210][211][212][213][214] "
- 10180 c$= "[163][163][163][163][163][163][163][163][163][163][163]"
- 10190 br$(0)=sp$
- 10200 for c1=1 to 10:read br$(c1)
- 10210 next c1
- 10220 read r$(0),r$(1)
- 10230 r$(2)=br$(2)+" ship"
- 10240 r$(3)=br$(3)+" ship"
- 10250 r$(4)=br$(2)+" "+br$(4)
- 10260 r$(5)=br$(3)+" "+br$(4)
- 10270 for c1=0 to 15:read co$(c1)
- 10280 next c1
- 10290 read sp$(1),sp$(2),sp$(3)
- 10300 read c(0),c(1),c(2),c(3)
- 10310 poke704,c(0):poke705,c(1):poke706,c(2):poke707,c(3)
- 10320 at=49152
- 10330 si=at+3:ch=si+3:sp=ch+3:se=sp+3
- 10340 fx=se+3:b1=fx+3:b2=b1+3
- 10350 pu=b2+3:cs=pu+3:bm=cs+3:sr=bm+3
- 10360 wp=sr+3:rv=wp+3:sc=rv+3:ex=sc+3
- 10370 pb=ex+3
- 10390 read bd,bk,bb,bi
- 10400 v=53248
- 10410 poke v+32,bd:poke v+33,bk:poke 54296,15
- 10420 return
- 10999 rem *board data*
- 11000 data 5,0,4,0,4,0,3
- 11010 data 0,0,6,0,0,0,0
- 11020 data 0,0,4,0,4,0,0
- 11030 data 1,15,1,15,1,15,1
- 11040 data 0,0,7,0,7,0,0
- 11050 data 0,0,0,0,11,0,0
- 11060 data 10,0,7,0,7,0,8
- 11070 data 9,5,10,30,55,100,40:rem *mv,dh,speeds,p2,p3
- 11080 data s,x,".","/",a
- 11090 data " blackhole ","player one"
- 11100 data "player two","destroyer:"
- 11110 data "destroyer:1","destroyer:2"
- 11120 data " debris "
- 11130 data "+,[129]-./" , "ship: plr.1"
- 11140 data "ship: plr.2"
- 11150 data " -missed- ","sucked into a blackhole... "
- 11160 data" black "," white "
- 11170 data" red "," cyan "
- 11180 data" purple "," green "
- 11190 data" dark blue "," yellow "
- 11200 data" orange "," brown "
- 11210 data" light red "," dark grey "
- 11220 data" mid grey ","light green"
- 11230 data"light blue","light grey"
- 11240 data" fast "," medium "
- 11250 data" slow "
- 11260 data 2,6,0,11
- 11270 data 0,15,14,0
-