home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Loadstar 4
/
004.d81
/
madman
(
.txt
)
< prev
next >
Wrap
Commodore BASIC
|
2022-08-26
|
6KB
|
209 lines
1 ifx=0thenx=1:load"break.ml",8,1
5 gosub60000
10 rem this program is designed to
20 rem be a double breakout game.
30 rem the action is sideways and
40 rem there are two paddles.
50 :
60 rem the ball and the paddles
70 rem are sprites.
72 rem
75 rem*********************************
80 rem* variable list *
81 rem* ************* *
82 rem* *
83 rem* dx -'x' increment ball *
84 rem* dy -'y' increment ball *
85 rem* bx -'x' ball position *
86 rem* by -'y' ball position *
87 rem* ss -sprite-sprite collision*
88 rem* sd -sprite-data collision *
89 rem* px -'x' position paddle *
90 rem* py -'y' position paddle *
92 rem* cc -sys to clear wall *
93 rem* nb -number of balls *
94 rem* sc$ -score (sc) *
95 rem* hs$ -hi score (hc) *
98 rem*********************************
99 hs$="0000"
100 poke783,peek(783)and254
150 rem
200 rem
1100 rem set up sprites
1110 rem
1120 poke2040,192
1130 poke2041,193
1135 poke2042,194
1136 poke2043,195
1137 poke2044,196
1138 poke2045,197
1140 forx=12288 to 12350:pokex,000:next
1150 forx=12352 to 12414:pokex,000:next
1152 forx=12416 to 12478:pokex,000:next
1153 forx=12480 to 12542:pokex,000:next
1154 poke12486,15:poke12487,255:poke12488,248
1155 poke12540,15:poke12541,255:poke12542,248
1160 forx=12288 to 12350 step3:pokex,192:next
1170 forx=12290 to 12350 step3:pokex,3:next
1180 poke12380,8:poke12383,28:poke12386,62:poke12389,28:poke12392,8
1185 poke12450,8
1187 forx=1to19:readloc,va:poke12480+loc,va:next
1188 forx=12544to12606:readq:pokex,q:next
1189 forx=12608to12670:readq:pokex,q:next
1190 :
1191 forx=12489to12537step3:pokex,12:pokex+2,24:next
1195 :
1200 rem initiate play
1202 :
1205 gosub31000:rem level input
1210 gosub30000:rem inti variables
1215 gosub31050:rem set up screen
1220 gosub31100:rem put sprites on
1225 :
1230 poke198,0:wait198,1
1235 sys49152
1240 ifpeek(51307)<>1then1400
1242 gosub41050
1243 sys49202
1244 goto1240
1245 :
1250 :
1275 zz=peek(v+31):zz=peek(v+30)
1300 :
1400 rem final score and hi-score
1402 rem for end of game.
1410 fs=peek(2018)-48-128:fs=fs*1000
1412 fs=fs+((peek(2019)-48-128)*100)
1414 fs=fs+((peek(2020)-48-128)*10)
1416 fs=fs+((peek(2021)-48-128)*1)
1420 pokev+21,0
1422 hs=peek(1995)-48-128:hs=hs*1000
1424 hs=hs+((peek(1996)-48-128)*100)
1426 hs=hs+((peek(1997)-48-128)*10)
1428 hs=hs+((peek(1998)-48-128)*1)
1430 iffs<hsthen1450
1432 poke1995,peek(2018)
1434 poke1996,peek(2019)
1436 poke1997,peek(2020)
1438 poke1998,peek(2021)
1440 hs$=right$(str$(fs),len(str$(fs))-1)
1442 iflen(hs$)<4thenz$="":forx=1to4-len(hs$):z$=z$+"0":next:hs$=z$+hs$
1450 print"[147]game over"
1451 print"final score is:";fs:iffs>hsthenprint"which is a new hi-score!!"
1452 print"want to play again (y/n)";:poke198,0:wait198,1:getz$
1454 ifz$<>"y"andz$<>"n"then1452
1456 ifz$="y"then1200
1458 :
1460 print"[147] * * * * the end * * * *"
1500 poke646,peek(53281):print"load"chr$(34)"payload"chr$(34)",8"
1502 print"run"
1505 poke631,13:poke632,13:poke198,2:end
1600 :
10000 data13,62,16,99,19,193,20,128,22,193,23,128,25,193,26,128,28,1,29,128
10002 data31,1,32,128,34,3,37,30,40,24,43,24,46,24,52,24,55,24
10005 :
10010 data1,255,224,3,0,48,6,0,24,12,0,12,24,192,198,24,192,198
10012 data24,0,6,24,12,6,24,30,6,24,63,6,24,0,6,24,0,6,25,0,38,27,000,54
10013 data25,128,102
10014 data12,127,140,6,30,24,3,0,48,1,255,224,0,0,0,0,0,0
10015 :
10020 data1,255,224,3,192,240,6,97,152
10022 data12,51,12,24,30,6,24,192,198
10024 data24,192,198,24,0,6,24,0,6
10026 data24,12,6,24,30,6,24,63,6,24,0,6,24,0,6
10028 data24,30,6,24,51,6,25,192,230
10030 data12,128,76,6,0,24,3,0,48,1,255,224
30000 rem variable init.
30005 v=53248:zz=peek(v+30):zz=peek(v+31)
30020 nb=6
30030 sc$="0000"
30040 px=158:py=100
30050 bx=100:by=100
30060 dx=2:dy=2
30070 poke783,peek(783)and254
30080 return
30085 :
31000 rem level input
31005 print"[147]level (0-20)";:inputlv:iflv<0orlv>20then31005
31010 poke53000,lv+5
31020 return
31025 :
31050 rem
31055 rem set up screen
31060 rem
31065 print"[147]";:poke53281,0:poke53280,7
31070 forx=0to23
31075 print" [209][156][209][209][209][146]";tab(35)"[209][209][156][209][209]"
31080 nextx
31085 print" [158] ";
31086 poke783,peek(783)and254
31090 poke781,24:poke782,02:sys65520
31095 print"hi-score:"hs$;" balls:";nb;" score:"sc$;
31097 print"[146]"
31098 return
31099 :
31100 rem put sprites on the screen
31105 pokev+23,0:pokev+29,1
31110 pokev,px:pokev+1,py
31115 pokev+2,bx:pokev+3,by
31120 pokev+4,bx:pokev+5,by
31125 pokev+6,168:pokev+7,130
31130 pokev+8,168:pokev+9,68
31135 pokev+10,168:pokev+11,192
31140 pokev+21,63:poke646,0:pokev+31,0
31142 forc=39to44:pokev+c,1:next
31143 pokev+44,7:pokev+43,5
31145 return
31150 :
41050 rem
41055 rem redraw screen
41060 rem
41065 print"";
41067 forll=217to242:pokell,peek(ll)or128:next
41070 forx=0to23
41075 print" [209][156][209][209][209][146]";tab(35)"[209][209][156][209][209]"
41080 nextx
41085 poke783,peek(783)and254
41086 poke781,24:poke782,02:sys65520
41087 print"[158]hi-score:";" balls:";" score:[146]";
41098 return
60000 poke783,peek(783)and254
60001 print"[147]":poke53281,0:poke53280,2
60002 poke781,peek(781)and254
60005 hb=0:he=39
60010 vb=0:ve=22:a$="[209]"
60015 :
60020 forx=hbtohestep6:poke781,vb:poke782,x:sys65520:printa$:next
60030 fory=vbtovestep6:poke781,y:poke782,he:sys65520:printa$:next
60040 forx=hetohbstep-6:poke781,ve:poke782,x:sys65520:printa$:next
60050 fory=vetovbstep-6:poke781,y:poke782,hb:sys65520:printa$:next
60060 hb=hb+1:he=he-1
60070 vb=vb+1:ve=ve-1
60080 ifhb=23andhe=16then61000
60090 goto60020
60095 :
61000 poke781,11:poke782,14:sys65520
61005 print" [157][157][157][157][157][157][157][157] [157][157][157][157][157][157][157][157] "
61010 poke781,12:poke782,16:sys65520:print"madman"
61015 poke781,23:poke782,13:sys65520:print"<press a key>"
61020 poke198,0:wait198,1:print"[147]madman":print
61025 print" by":print
61030 print"alan w. gardner":print:print:print
61035 print" adapted from an idea from tom spidell"
61040 poke781,23:poke782,13:sys65520:print"<press a key>"
61045 poke198,0:wait198,1
61050 print"[147] this game is very similar to most of":print
61055 print"the old 'breakout' games. the object ":print
61060 print"of the game is to knock down as much of":print
61065 print"the wall as possible with the ball.":print
61070 print" try to avoid mr. mad because he will ":print
61080 print"eat your ball!!":print
61085 print" mr. happy is o.k. to run into because":print
61090 print"he will let your ball pass on by.":print
61095 print" the question mark is o.k. sometimes,":print
61100 print"but deadly at other times.":print
61105 print" the paddles are controlled by a joy-":print
61110 print"stick in port #2."
61120 poke781,23:poke782,10:sys65520:print"<press a key to play>"
61125 poke198,0:wait198,1:return