home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
UpTime Volume 1 #4
/
utv1n4s1.d64
/
rob.p
(
.txt
)
< prev
next >
Wrap
Commodore BASIC
|
2022-08-28
|
11KB
|
452 lines
100 rem ***************************************
110 rem ** escape from the alien robots **
120 rem ** **
130 rem ** bruce jaeger, st. paul minn. **
140 rem ***************************************
150 rem
180 poke 2045,peek(52):poke 2046,peek(56) : remember limits
190 poke 52,56:poke56,56:clr:rem protect characters
200 poke 2043,1:poke 2044,5:rem init degre of difficulty
210 gosub 3580 : rem poke ml, read characters
230 gosub 4000 : rem initialize variables
400 gosub 10000 : rem copyright screen
410 gosub 2100 : rem instructions
425 :
430 remark: program restart point here
431 rem **************************
432 :
434 poke 54273,0:rem sound off
435 clr : rem "make [211][213][210][197] everything is reset!
436 [141] 4000 : [143] initialize variables
437 [141] 2770 : [143] new lev diff
440 [141] 3430 : [143] draw fence
450 [141] 4200 : [143] create random internal pits
460 [141] 4300 : [143] create random barriers
580 [141] 4400 : [143] locate human character
590 [141] 4500 : [143] place robots
720 [141] 2010 : [143] wait for fire button
721 dt[178](7[171]dk)[172]25 : [143] delay between moves
722 :
730 [143]ark: main-action-loop
735 [143] ******************** <<<<<<<<<<<<<
740 [143]ark: get joystick value
750 ti$[178]"000000" : am [178] 0
770 js[178][194](jt [170] ([194](jp)[175]15))
780 [161] kp$: [139] kp$[178][199](140) [167] 2760
790 [139] js[179][177]0 [167] 820
800 [139] ti[179]dt [167] 770
810 am[178]1 : [143] automatic move
815 :
820 [143]ark: move-the-human
830 oy[178]hy : ox[178]hx
845 [143] if am then 930
850 [139] js[178]1 [167] hy[178]hy[171]1 : [137] 930
860 [139] js[178]2 [167] hy[178]hy[171]1 : hx[178]hx[170]1 : [137] 930
870 [139] js[178]3 [167] hx[178]hx[170]1 : [137] 930
880 [139] js[178]4 [167] hy[178]hy[170]1 : hx[178]hx[170]1 : [137] 930
890 [139] js[178]5 [167] hy[178]hy[170]1 : [137] 930
900 [139] js[178]6 [167] hy[178]hy[170]1 : hx[178]hx[171]1 : [137] 930
910 [139] js[178]7 [167] hx[178]hx[171]1 : [137] 930
920 [139] js[178]8 [167] hy[178]hy[171]1 : hx[178]hx[171]1 : [137] 930
925 :
930 [143]ark: move pieces
940 [141] 3340 : [143] ding
950 xc[178]hx : yc[178]hy
970 [139] am [167] [137] 1020
980 [141] 1390:[143] set pv=peek(dest)
990 [139] pv[177]90 [175] pv[179]103 [167] [137] 2470
991 [143] 109=barrier:103=pit:106=robot
1000 [139] pv [178] 103 [167] [137] 2530
1010 [139] pv [178] 106 [167] [137] 2590
1015 [139] pv[178]109 [167] xc[178]ox:hx[178]ox:yc[178]oy:hy[178]oy
1020 [143]ark: alternatecharacter
1030 [139] hu[178]1 [167] hu[178]2:pd$[178]hc$:[137] 1050
1040 hu [178] 1 : pd$ [178] h2$
1050 p1$ [178] h1$
1060 [141] 1740
1061 :
1065 [143] move robots
1070 [129] i [178] 1 [164] nr
1080 rx [178] rx(i)
1090 ry [178] ry(i)
1100 [139] rx[178]0 [176] ry[178]0 [167] [137] 1280
1110 ox [178] rx
1120 oy [178] ry
1130 rx [178] [180](hx [171] rx) [170] ox
1140 ry [178] [180](hy [171] ry) [170] oy
1150 rx(i) [178] rx
1160 ry(i) [178] ry
1170 xc[178]rx
1180 yc[178]ry
1190 [141] 1390
1200 [139] pv[177]90 [175] pv[179]103 [167] [141] 1670:[137] 1280
1210 [139] pv [178] 103[167][141]1590:[137] 1280
1220 [139] pv [178] 104 [176] pv[178]108 [167] hd[178]1
1225 [139] pv[178]109 [176] pv[178]106 [167] xc[178]ox:rx[178]ox:yc[178]oy:ry[178]oy:rx(i)[178]ox:ry(i)[178]oy
1230 xc [178] rx
1240 yc [178] ry
1250 pd$ [178] rc$
1260 p1$ [178] r1$
1270 [141] 1740
1280 [143]ark: loopskip
1290 [130] i
1300 [139] hd [167] [137] 2590
1310 [139] lr[178]0 [137] 2400
1320 [137] 730
1330 [143]ark: subroutines ********************
1340 [143]ark: find.empty.spot.in.compound
1345 [143] (at random)
1350 yc[178][181]([187](1)[172]14)[170]3
1360 xc[178][181]([187](1)[172](ho[171]6))[170]4
1370 [141] 1390 : [139] pv[179][177]32 [167] [137] 1350
1380 [142]
1385 :
1390 [143]ark: peek.a.place
1400 [141] 1560
1420 pv [178] [194](pa):[142]
1430 :
1480 [143] poke.a.place
1490 [141] 1560
1510 [151] pa, pv : [142]
1520 :
1560 [143]ark: calculate.address
1570 pa[178]ss[170]cw%[170]((yc[171]2)[172]cw%)[170]xc[170]2
1580 [142]
1585 :
1590 [143]ark: blow.up.pit
1600 xc [178] rx
1610 yc [178] ry
1620 pd$ [178] bm$
1630 p1$ [178] b1$
1640 [141] 1740 : [143] draw a piece
1650 [141] 3160 : [143] explosion
1651 [141] 1670
1652 [142]
1665 :
1670 [143]ark: kill.robot
1680 rx(i)[178]0 : ry(i)[178]0
1690 lr[178]lr[171]1
1700 [139] pv[179][177]103 [167] [142]
1710 [153] [200](cd$,ry);
1720 [153] [163]rx[170]2) sp$ [199](19);
1730 [142]
1735 :
1740 [143]ark: draw.a.piece
1750 [153][199](19);
1760 [153] p1$;
1770 [139] ox[178]0 [175] oy[178]0 [167] [137] 1800
1780 [153] [200](cd$,oy);
1790 [153] [163]ox[170]2) sp$ [199](19);
1800 [153] [200](cd$,yc);
1810 [153] [163]xc[170]2) pd$ [199](19);
1820 [142]
1825 ::
1880 [143]ark: printline
1890 z$[178]se$ : [139] z$[178]"" [167] [142]
1900 z[178]cw%[171]1[171][185](0): [139] z[179]cw%[171]2 [137] 1920
1910 [139] [200](z$,1)[178]" " [167] z$[178][202](z$,2) : [137] 1910
1920 [139] [195](z$)[179][178]z [167] [153] z$; : [142]
1930 [139] z[179]2 [167] [153] : [137] 1900
1940 [129]z1[178]z[164]1[169][171]1:[139][202](z$,z1,1)[179][177]" "[167][130]z1
1950 [139]z1[178]0 [167] [153] : [137] 1900
1960 [153] [200](z$,z1);
1970 z$[178][202](z$,z1[170]1) : [137] 1900
1980 :
2010 [143]ark: wait-for-fire-button
2020 [153] [200](cd$,24);
2030 se$ [178] "(NULL)ress ascright$(NULL)val peek(NULL)(NULL)(NULL)(NULL)(NULL) when ready"
2035 [153][199](5); : [141] 3390
2040 se$ [178] "(NULL)ress asc8 for (NULL)p(NULL)ime"
2045 [153][199](13); : [141] 3390 : [153][199](19);
2050 js [178] [194](jp) [175] 16
2055 [161] kp$: [139] kp$[178][199](140) [167] 2760
2060 [139] js [178]16 [137] 2050
2070 [153] [200](cd$,24);
2080 [153]" ";
2090 [142]
2095 :
2100 [143]ark: instructions
2110 [151] 53272,30 : [143] enable custom characters
2120 se$ [178] "val(NULL)lenatn(NULL)val asc(NULL)(NULL)(NULL) (NULL)left$val (NULL)right$(NULL)(NULL)val(NULL) (NULL)(NULL)peek(NULL)(NULL)(NULL)"
2140 [153]"load"[199](8)[199](11);
2150 [153] [199](5) [199](18);
2160 [141] 3390 : [143] print string in center
2170 [153] [199](158) [199](17)
2180 [153]"(NULL)ou are trying to escape from a pack of"
2190 [153]"nasty aliens, who have tossed you into"
2200 [153]"a prison compound surrounded by an elec-";
2210 [153]"trified fence. str$eadly pits (";b2$;bc$;[199](158)") have"
2230 [153]"also been dug all over the prison yard."
2231 [153]"peekarriers (list"ba$"sys) are also scattered through-out the compound."
2235 [153]
2240 [153]"(NULL)owerful (but stupid) (NULL)obots (";r1$;rc$;[199](158);") patrol"
2250 [153]"the yard; they are programmed to destroy";
2260 [153]"you (";h1$;hc$;[199](158);
2270 [153]"), regardless of their own fate."
2280 [153]"(NULL)o survive, you must move";
2290 [153]" about so that the (NULL)obots blunder into";
2300 [153]" the pits and ex-plode. ((NULL)he debris";
2310 [153]" then fills the pit"
2311 [153]"up!) atnlso, hide behind the barriers"
2315 [153]"whenever you can."
2320 [153] : [153]
2330 [153]" (NULL)se a joystick plugged into port #2"
2340 [153]"to control your movement.":[153]:[153]
2350 [141] 2010
2360 [153][199](147);
2370 [143] gosub 2770 : rem get level of diff (dk)
2380 [153][199](147);
2390 [142]
2395 :
2400 [143]ark: you.escaped!!!
2410 [153] [200](cd$,19);
2420 [153][199](5);
2430 [153] " (NULL)ou've destroyed all the robots! "
2440 [153] " (NULL)he electrified fence loses power..."
2450 [153] " (NULL)ou make your escape!" : [153]:[153]
2460 [137] 2710
2465 :
2470 [143]ark: you.touched.a.fence
2480 [141] 3230
2490 [153] [200](cd$,19);
2500 [153][199](150);
2510 [153] " atnaargh! (NULL)hat fence was electrified!"
2520 [137] 2660
2525 :
2530 [143]ark: you.touched.a.pit
2540 [141] 3230
2550 [153] [200](cd$,19);
2560 [153][199](150);
2570 [153] " (NULL)oops! (NULL)hat pit was deadly!"
2580 [137] 2660
2585 :
2590 [143]ark: they.caught.you.and.you're.dead
2600 [141] 3230
2610 [153] [200](cd$,19);
2620 [153][199](153);
2630 [153] " (NULL)he nasty alien robots";
2640 [153]" have recaptured and microwaved you!!!" :[153]
2650 [137] 2660
2655 :
2660 [143]ark: rest-in-peace
2670 [153][199](158);
2680 [153][199](146);
2690 [153]:[153]" (NULL