02 – Funambolo
Apparso da pagina 9 fino a pagina 15 de “Il libro dei giochi del Commodore 64”
Il listato pubblicato
Il programma

Il nostro listato digitato
Qui di seguito trovate il codice da copiare sul programma CBM prg Studio Il codice originale é stato modificato affinchè possa essere letto da CBM prg Studio. I caratteri speciali PETSCII (Screen Codes) presenti nel listato originale, sono stati singolarmente sostituiti da quelli standard utilizzati da CBM prg Studio. Attenzione – Grazie alla segnalazione di più utenti, i caratteri “<” e “>” potrebbero venir sostituiti dai rispettivi encoding html “<” e “>” . Qualora li trovaste, sostituite manualmente questi valori direttamente su CBM prg Studio, altrimenti il programma non funzionerà. Scusate per l’inconveniente tecnico.
10 rem ** funambolo **
20 g=0:h=0:d=0:pd=0:s=0:b=0:bp=0
25 poke13500,0:poke13501,255:poke13502,255
30 w=0:ns=0:ff=0:poke649,1
40 print"{clear}":poke53280,7:poke53281,1
50 poke52,48:poke56,48:clr:poke56334,peek(56334)and254:poke1,peek(1)and251
60 forj=0to111:readx:poke12416+j,x:next
70 poke1,peek(1)or4:poke56334,peek(56334)or1
80 input"{clear}{blue}{down}{right*2}livello di gioco ";l$
90 l=val(l$):ifl<1orl>10then80
95 ms=peek(13500):ft=peek(13501)+peek(13502)*256
100 print"{clear}";:poke53272,(peek(53272)and240)+12
110 dima(24),b(24),s(24):g=1024:h=55296:lr=-1
120 forj=0to24
130 reada(j)
140 reads(j)
150 readb(j)
160 next
170 d$="{red}zzz{blue}zrr{red}zzzrrrzzzrrrzzzrrrzzzrrrzzzrrr{blue}z{red}zzz"
180 forj=0to5
190 printd$;
200 next
210 print"zz{blue}zzzr{red}zzzrrrzzzrrrzzzrrrzzzrrrzzzrr{blue}zzz{red}zz"
220 forj=0to13
230 printd$;
240 next
250 print"{black}[[[[r[{red}z{black}[[r[[[{red}zz{black}[[[[[{red}z{black}[[r[[{red}z{black}[[[[[{blue}z{black}[[{red}z";
260 forj=0to39
270 print"{purple}z{green}£";
280 next
290 forj=0to22
300 pokeg+968+j,29
310 next
320 pokeh+979,2
330 pokeh+164,9:pokeh+204,9:pokeg+164,16:pokeg+204,17
340 forj=165to195
350 pokeh+j,1:pokeg+j,18:pokeh+j+40,9:pokeg+j+40,19
360 next
370 ti$="000000"
380 j=0
390 d=a(j)+s*s(j)+b*b(j)+bp+w
400 gosub1000
410 ifff=1then740
420 j=j+1:ifj<25then390
430 gosub2000
440 ifns=31then680
450 j=0
460 d=a(24-j)+s*s(j)+b*b(j)+bp+w
470 gosub1000
480 ifff=1then740
490 j=j+1:ifj<25then460
500 gosub2000
510 ifns=31then680
520 j=0
530 d=-a(j)+s*s(j)+b*b(j)+bp+w
540 gosub1000
550 ifff=1then740
560 j=j+1:ifj<25then530
570 gosub2000
580 ifns=31then680
590 j=0
600 d=-a(24-j)+s*s(j)+b*b(j)+bp+w
610 gosub1000
620 ifff=1then740
630 j=j+1:ifj<25then600
640 gosub2000
650 ifns=31then680
660 w=(l-1)*(int(rnd(1)*7)-3)
670 goto380
680 print"{clear}":poke53280,6:poke53281,9:poke53272,21
690 t=int(ti/60)
700 print"{down*3}{right} traversata completa in ";t;" secondi"
710 ift" "then790
795 poke13500,ms:poke13502,int(ft/256):poke13501,ft-peek(13502)*256
800 restore:clr:goto40
1000 ifabs(d)>200-7*lthenff=1
1010 pokeh+979+pd/20,1:pokeh+979+d/20,2:pd=d
1020 return
2000 s=s*-.5
2010 ifb<>0thenbp=bp+10*sgn(b):b=0
2020 geta$
2030 ifa$="s"thens=lr:lr=-sgn(lr):ns=ns+1:gosub3000
2040 ifa$="x"thenb=1
2050 ifa$="z"thenb=-1
2060 return
3000 pokeg+163+ns,22:pokeg+164+ns,24:pokeg+203+ns,23:pokeg+204+ns,25
3010 pokeh+164+ns,9:pokeh+204+ns,9
3020 fork=1to400:next
3030 pokeg+163+ns,18:pokeg+164+ns,20:pokeg+203+ns,19:pokeg+204+ns,21
3040 ifns=31thenpokeg+195,16:pokeg+235,17:fork=1to5000:next
3050 return
4000 data129,153,189,153,90,60,24,24,24,24,36,36,36,36,102,255
4010 data0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255
4020 data0,48,96,120,112,34,25,160,160,32,80,72,72,72,108,255
4030 data3,6,7,39,18,15,2,2,2,5,4,4,4,4,2,255
4040 data0,0,128,0,0,0,128,64,32,128,64,128,128,64,0,255
4050 data255,255,255,255,255,255,255,255
4060 data0,60,60,126,126,60,24,24,24,60,126,255,255,126,60,24
4070 data24,126,219,153,24,24,24,24
5000 data3,2,25,9,12,46,16,21,50,22,30,49,28,38,47
5010 data34,46,44,40,55,41,45,60,37,51,65,33,56,69,28
5020 data61,72,25,66,74,23,71,75,21,75,74,18,79,72,17
5030 data83,69,15,86,65,13,89,60,12,92,55,17,94,46,11
5040 data96,38,10,98,30,10,99,21,10,100,12,10,100,2,10
Il file .PRG del listato
Provalo direttamente sull’emulatore! Clicca sul pulsante per avviare!
Downloading…