home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Loadstar 32
/
032.d81
/
gobbler
(
.txt
)
< prev
next >
Wrap
Commodore BASIC
|
2022-08-26
|
5KB
|
155 lines
0 goto70
10 poke54276,.:poke54273,160:poke54272,100:poke54277,5:poke54278,5
20 poke54276,33:return
30 forqz=100to130step5:poke54276,.:poke54273,qz:poke54272,100
40 poke54276,33:next:return
50 poke54276,.:poke54273,10:poke54272,100:poke54277,3:poke54278,1
60 poke54276,129:return
70 poke53272,(peek(53272)and240)or14
80 poke55,255:poke56,47:poke53248+21,.
90 def fna(j)=(j+2)+4*(j>1)
100 v=53248:d=54272:gs=0:ys=0:q=192:d$=""
105 pokev+28,.
110 dima(3),n(70),dr(70):a(0)=2:a(1)=-80:a(2)=-2:a(3)=80
120 poke53280,.:poke53281,.:print"[147] [158]loadstar presents:"
130 print"[159] gobbler's revenge":print" by j c hilty"
140 print" please wait --- setting up":a=1
150 read n(a),dr(a):ifn(a)=0then210
160 a=a+1:goto150
210 gosub1250
220 print"[147]":poke53280,0:poke53281,0
230 fori=0to24:poked+i,0:next
240 n$=" g o b b l e r ' s r e v e n g e"
250 print""
260 print"[159]"
270 fort=1to37
280 printright$(n$,t);"[145]"
290 fori=0to15:nexti
300 poked,150:poked+1,200:poked+5,8:poked+6,248:poked+24,15:poked+4,17
310 fori=0to15:next i
320 poked+4,16
330 next t
340 poked+24,0
350 print""tab(15)"[129]by j c hilty"
360 print" <press the fire button to start>"
370 z8=1:gosub1050:ifpeek(56320)and16then370
380 poke54276,.:fort=0to1000:next
390 pokev+21,0
400 print"[147]":poke53281,0:poke53280,8:g1=.:y1=.
410 sys49160
420 a=1105:l=1141:g=42:p=28:cm=54272:j=2:h=90
430 print" [158]g o b b l e r ' s r e v e n g e"
440 printd$tab(2)" gobbler score your score"
450 printtab(6)gs;" "ys
460 pokev+23,0:pokev+29,0:pokev+0,174:pokev+1,226:q=192:poke2040,q
470 pokev+21,1:poke1105,g:poke1105+cm,7:poke1141,p:poke1141+cm,10
480 poke1835,h:poke1835+cm,13:poke1857,h:poke1857+cm,13
490 poke1509,h:poke1509+cm,13:poke1599,h:poke1599+cm,13
500 poke1605,h:poke1605+cm,13:poke1113,h:poke1113+cm,13:poke1137,h
510 poke1137+cm,13
520 fort=0to2000:next:rem main loop
530 q=q+1:ifq=198thenq=192
540 poke2040,q
550 b=a+a(j)/2
560 ifpeek(b)=32thenpokeb,g:pokeb+cm,7:pokea,32:a=b:j=fna(j)
570 ifpeek(b)=46thenpokeb,g:pokeb+cm,7:pokea,32:a=b:j=fna(j):gosub960
575 ifpathenpa=.:goto400
580 ifpeek(b)=90thenpokeb,g:pokeb+cm,7:pokea,32:a=b:j=fna(j):gosub1000
585 ifpathenpa=.:goto400
590 ifpeek(b)=28then680
600 j=(j-1)-4*(j=0)
610 sys(828):r=peek(254)-peek(253)
620 ifr=0then530
630 w=peek(l+r)
640 ifw=46thenl=l+r:pokel-r,32:pokel,p:pokel+cm,10:gosub980:gosub10
642 ifw=46andpathenpa=.:goto400
644 ifw=46then530
650 ifw=90thenl=l+r:pokel-r,32:pokel,p:pokel+cm,10:gosub1020:gosub30
652 ifw=90andpathenpa=.:goto400
655 ifw=90then530
660 ifw<>32then530
670 l=l+r:pokel-r,32:pokel,p:pokel+cm,10:gosub50:goto530
680 rem gobbler eats player
690 gs=gs+1000
700 forx=dtod+24:poked,0:next
710 poked+24,15:poked+5,15:poked+12,15:poked+19,15:poked+6,107
720 poked+14,107:poked+14,50:poked+15,40
730 poked+4,33:poked+11,23:poked+18,23
740 forf1=10to50step1:poked+1,f1
750 forf2=30to1step-5:poked+8,f2
760 nextf2:nextf1
770 poked+4,32:poked+11,32:poked+18,32
780 print"[147]":pokev+21,0
790 print""tab(4)"ha!!!! the gobbler gobbled you up!"
800 fort=0to2000:next:goto810
810 rem game over
820 fort=0to1000:next
830 print"[147]":pokev+21,0:poke53280,0
840 gosub1250
850 ifgs>ysthenprint""tab(7)"hey! the gobbler wins again!"
860 ifys>gsthenprint""tab(7)"uhoh -- i guess you win one"
870 print:print:printtab(8)"gobbler score ";gs
880 print:printtab(8)"your score ";ys
890 print" [159]<press the fire button to play again>"
900 print" <press the space bar to quit>"
910 z8=.:gosub1050:ifa$=" "then940
920 if(peek(56320)and16)=.then950
930 goto910
940 print"[147]":poke54276,.:pokev+21,.:open15,8,15,"r0:hello connect=hello connect"
942 input#15,er:close15:ifer<>63thenend
943 poke53272,21
944 load "hello connect",8
950 gs=0:ys=0:goto380
960 gs=gs+10:g1=g1+10:print"":printd$""tab(6)" [157][157][157][157][157][157][157][157][157]"gs
965 ifg1+y1=2590thenpa=-1
970 return
980 ys=ys+10:y1=y1+10:print"":printd$""tab(28)" [157][157][157][157][157][157][157][157][157]"ys
985 ifg1+y1=2590thenpa=-1
990 return
1000 gs=gs+100:g1=g1+100:print"":printd$""tab(6)" [157][157][157][157][157][157][157][157][157]"gs
1005 ifg1+y1=2590thenpa=-1
1010 return
1020 ys=ys+100:y1=y1+100:print"":printd$""tab(28)" [157][157][157][157][157][157][157][157][157]"ys
1025 ifg1+y1=2590thenpa=-1
1030 return
1040 end
1050 rem play music
1060 restore:a=1
1070 forl=0to24:poked+l,0:next
1080 poked+3,8:poked+5,41:poked+6,89:poked+14,117:poked+18,16:poked+24,143
1100 if n(a)=0 then return
1110 geta$:ifa$=" "andz8=.thenreturn
1120 if(peek(56320)and16)=.thenreturn
1130 poked+4,65
1140 fort=1todr(a)
1150 geta$:ifa$=" "andz8=.thenreturn
1160 if(peek(56320)and16)=.thenreturn
1170 fq=n(a)+peek(d+27)/2
1180 hf=int(fq/256):lf=fqand255
1190 poked+0,lf:poked+1,hf
1200 next
1210 poked+4,64
1220 q=q+1:ifq=198thenq=192
1230 fort=2040to2047:poket,q:next
1240 a=a+1:goto1100
1250 rem sprite setups
1260 fori=2040to2047:pokei,q:next
1270 fori=39to46:pokev+i,7:next
1280 pokev+29,255:pokev+23,255
1290 pokev+0,26:pokev+1,54:pokev+2,165:pokev+3,54
1300 pokev+4,26:pokev+5,125:pokev+6,26:pokev+7,205
1310 pokev+8,165:pokev+9,205
1320 pokev+16,224
1330 pokev+10,40:pokev+11,54
1340 pokev+12,40:pokev+13,125:pokev+14,40:pokev+15,205
1350 pokev+21,255 :return
1360 rem music data
1370 data 9634,8,6430,2,7217,2,8101,2,8583,2,9634,8,6430,4,6430,4
1380 data 10814,8,8583,2,9634,2,10914,2,12139,2,12860,8,6430,4,6430,4
1390 data 8583,8,9634,2,8583,2,8101,2,7217,2,8101,8,8583,2,8101,2,7217,2
1400 data 6430,2,6069,8,6430,2,7217,2,8101,2,6430,2,7217,2,12139,4,12139,4
1410 data 12139,4,9634,8,6430,2,7217,2,8101,2,8583,2,9634,8,6430,4,6430,4
1420 data 10814,8,8583,2,9634,2,10814,2,12139,2,12860,8,6430,4,6430,4,8583
1430 data 8,9634,2,8583,2,8101,2,7217,2,8101,8,8583,2,8101,2,7217,2,6430,2
1440 data 7217,8,8101,2,7217,2,6430,2,6069,2,6430,4,12860,4,12860,8,0,0