Looking for certain MSX BASIC game titles already written from book.

Page 2/3
1 | | 3

By Briqunullus

Champion (428)

Briqunullus's picture

28-10-2021, 20:56

Take a look at line 170. The range of P$ is set there. Should that be 14,12? Or should m in line 280 only loop to 2?

By foody

Champion (325)

foody's picture

28-10-2021, 21:05

140 clear 5000:DEFINT a-z:key OFF
150 color 15,1,1:SCREEN 1,2:width 32
160 deffnq$(a,b)=right$("00000"+mid$(str$(a),2,len(str$(a))-1),b)
170 dim p$(14,2)
180 for n=1 to 10:b$=""
190 for m=0 to 31:read a$
200 b$=b$+chr$(val("&H"+a$)):NEXT
210 sprite$(n)=b$:NEXT
220 for n=776 to 855:read A$
230 a=val("&H"+A$):vpoke n,a:NEXT
240 for n=896 to 903:read A$
250 a=val("&H"+a$):vpoke n,a:NEXT
260 vpoke 8204,26:vpoke 8205,26
270 vpoke 8206,202
280 for n=0 to 14:for m=0 to 2
290 read p$(n,m):next m,N
300 CLS
310 locate 6,4:print string$(20,112)
320 print tab(6);"p RAILROAD         p"
330 PRINT TAB(6);STRING$(20,112)
340 LOCATE 0,9:PRINT STRING$(160,103)
350 LOCATE 0,11:PRINT STRING$(32,97)
360 LOCATE 10,10:PRINT CHR$(105)
370 LOCATE 3,22:PRINT " PRESS SPACEBAR TO BEGIN "
380 M=0:FOR N=0 TO 1000:NEXT
390 M=M+1:PUT SPRITE 1,(M,78),4,1
400 FOR JS=0 TO 2:I=STRIG(JS)
410 IF I THEN 430
420 NEXT:GOTO 390
430 GOSUB 1570
440 RESTORE 2530:FA=1:PO=0:VI=3
450 GOSUB 1600:TE=999
460 FOR W=1 TO NT
470 IF W=1 THEN CO=1 ELSE CO=4
480 PUT SPRITE W+1,(X(W)*8,Y(W)*8-9),CO,PT(W)
490 FOR N=2 TO NT
500 IF X(1)=X(N) AND Y(1)=Y(N) THEN GOTO 1330
510 NEXT N 
520 GOSUB 700
530 NEXT W 
540 LOCATE 20,0:TE=TE-1:PRINT FNQ$(TE,3)
550 IF TE=0 THEN GOSUB 1570:GOTO 1490
560 ED=X(1)+Y(1)*32+6144
570 IF VPEEK(ED+1)=112 THEN VPOKE ED+1,103:GOSUB 840
580 IF VPEEK(ED-32)=112 THEN VPOKEED-32,103:GOSUB 840
590 I=STICK(JS)
600 IF I=1 THEN CY=CY-3
610 IF I=5 THEN CY=CY+3
620 IF I=3 THEN CX=CX+3
630 IF I=7 THEN CX=CX-3
640 IF CX<2 THEN CX=29
650 IF CX>29 THEN CX=2
660 IF CY<3 THEN CY=21
670 IF CY>21 THEN CY=3
680 PUT SPRITE 1,(CX*8-4, CY*8-5),6,9
690 GOTO 460
700 X(W)=X(W)+FX(W):Y(W)=Y(W)+FY(W)
710 Q(W)=P(W)
720 P(W)=VPEEK(X(W)+Y(W)*32+6144)-97
730 IF P(W)=7 THEN RETURN
740 IF P(W)=Q(W) THEN RETURN
750 IF P(W)=2 AND (FX(W)=-1 OR FY(W)=-1) THEN PT(W)=4-4*FX(W):SWAP FX(W),FY(W):FX(W)=-FX(W):FY(W)=-FY(W):RETURN 
760 IF P(W)=3 AND (FX(W)=1 OR FY(W)=-1) THEN PT(W)=3-4*FY(W):SWAP FX(W), FY(W):RETURN 
770 IF P(W)=4 AND (FX(W)=1 OR FY(W)-1) THEN PT(W)=4+4*FY(W):SWAP FX(W), FY(W):FX(W)=-FX(W):FY(W)=-FY(W)
780 IF P(W)=5 AND (FX(W)=-1 OR FY(W)=1) THEN PT(W)=3-4*FX(W):SWAP FX(W),FY(W):RETURN 
790 IF Q(W)=0 THEN FX(W)=-FX(W):X(W)=X(W)+FX(W)
800 IF Q(W)=1 THEN FY(W)=-FY(W):Y(W)=Y(W)+FY(W)
810 IF P(W)=0 THEN PT(W)=3-2*FX(W)
820 IF P(W)=1 THEN PT(W)=4-2*FY(W)
830 RETURN
840 PO=PO+10
850 LOCATE 8,0:PRINT FNQ$(PO,5)
860 SOUND 7,56, SOUND 10,16:SOUND 13,0
870 SOUND 12,10:SOUND 5,1:SOUND 4,0
880 NB=NB-1
890 IF NB>0 THEN RETURN
900 INTERVAL OFF:STRIG(JS) OFF
910 BEEP:PLAY "S0M6000L8CC16C16DCEF2"
920 IF PLAY(0) THEN 920
930 GOSUB 1570
940 LOCATE 10,11:PRINT "                "
950 LOCATE 10,12:PRINT " HAPPY BIRTHDAY "
960 LOCATE 10,13:PRINT "                "
970 FOR N=0 TO 5000:NEXT
980 PLAY "V15L16CFB"
990 LOCATE 10,12:PRINT " BONUS: ";FNQ$(TE,3)
1000 FOR N=0 TO 5000:NEXT
1010 PO=PO+TE
1020 FA=FA+1
1030 IF FA=11 THEN RESTORE 2530
1040 GOTO 450
1050 ED=CX+CY*32+6144
1060 DT=VPEEK(ED)-97:DA=DT
1070 IF DT>5 OR DT<2 THEN RETURN
1080 DN=VPEEK(ED-32)
1090 DS=VPEEK(ED+32)
1100 DL=VPEEK(ED+1)
1110 D0=VPEEK(ED-1)
1120 DT=DT+1:IF DT=6 THEN DT=2
1130 IF DT=DA THEN RETURN
1140 if dt=2 and ds<>103 and dl<>103 then 1190
1150 if dt=3 and ds<>103 and d0<>103 then 1190
1160 if dt=4 and dn<>103 and d0<>103 then 1190
1170 if dt=5 and dn<>103 and dl<>103 then 1190
1180 goto 1120
1190 sound 7,28:sound 6,31:sound 10,16
1200 sound 13,4:sound 12,2
1210 vpoke ed,dt+97:RETURN
1220 SOUND 7,56:mu=mu+1
1230 if mu=9 then mu=1
1240 if mu>7 THEN RETURN
1250 if mu=1 then rem play"V904L4T254AF#8R82R4F#GA","T25403V7DA02A03ADA02A03A"
1260 if mu=2 then rem play "05F#R4F#R4D1","D04D02A04D03DBAF#"
1270 if mu=3 then rem play "04AF#8R8R2R4F#GF#","03DA02A03ADA02A03A"
1280 IF MU=4 THEN rem PLAY "04AR4AR4G1","03C#04C#02A04C#03C#EAB"
1290 if mu=5 then rem play "GE8R8R2R4EF#G","04C#03A02A04C#03C#A02A04C#"
1300 IF MU=6 THEN rem PLAY "AF#8R8R2R4F#G#.F#8","03DA02A03AD04DC2"
1310 IF MU=7 THEN rem PLAY "EAR4F$G#ER4BA1A1","03EA04C#E03EB04DED03BAF#D"
1320 RETURN
1330 INTERVAL off:strig(js) OFf:
1340 beep:sound 7,7:sound 8,16
1350 sound 6,31:sound 13,0:sound 12,60
1360 PUT SPRITE 1,(x(1)*8,y(1)*8-9),6,10
1370 for n=0 to 5000:NEXT
1380 gosub 1570
1390 vi=vi-1
1400 if vi<0 then 1490
1410 for n=1 to nt
1420 x(n)=og(n,1):y(n)=og(n,2)
1430 fx(n)=og(n,3):fy=og(n,4)
1440 p(n)=vpeek(x(n)+y(n)*32+6144)-97
1450 pt(n)=p(n)-2*(fx(n)+fy(n))+3
1460 NEXT
1470 gosub 14780
1480 goto 460
1490 BEEP:INTERVAL OFF:strig(js) OFF
1500 locate 10,11:print "            "
1510 locate 10,12:print "  GAME OVER "
1520 locate 10,13:print "            "
1530 sound 7,56:play "V14L32BAGFEDC4"
1540 for n=0 to 2
1550 if strig(n) then 300
1560 next:goto 1540
1570 for n=0 to nt
1580 put SPRITE n+1,(0,0),0,n:NEXT:
1590 return
1600 CLS:PRINT " Points:";FNQ$(po,5);" Time:999 Steps:";FNQ$(fa,2)
1610 print " ";string$(30,103)
1620 for n=0 to 6
1630 read a$:for m=0 to 9
1640 a=val("&H"+mid$(a$,m+1,1))
1650 locate m*3+1,n*3+2:print p$(a,0)
1660 locate m*3+1,n*3+2:print p$(a,1)
1670 locate m*3+1,n*3+4:print p$(a,2)
1680 next m,N 
1690 read nb,nt:for n=1 to nt
1700 for m=1 to 4
1710 read og(n,m):next m,N
1720 for n=1 to nt
1730 x(n)=og(n,1):y(n)=og(n,2)
1740 fx(n)=og(n,3):fy(n)=og(n,4)
1750 p(n)=vpeek(x(n)+y(n)*32+6144)-97
1760 pt(n)=p(n)-2*(fx(n)+fy(n))+3
1770 NEXT
1780 cx=2:cy=3
1790 locate 13,1
1800 print STRING$(vi,106);chr$(103)
1810 mu=0:gosub 1220
1820 strig(js) ON
1830 on strig gosub 1050,1050,1050
1840 interval ON
1850 on INTERVAL=113 gosub 1120
1860 RETURN
1870 data 00,00,00,00,FF,71,71,71 
1880 DATA 7F,7F,7F,7F,FF,1E,0C,00
1890 DATA 00,00,00,00,3C,18,18,FE
1900 DATA FE,FF,FF,FE,FE,78,30,00
1910 DATA 10,1F,1F,3F,7F,7F,3F,1F
1920 DATA 1F,3F,7F,7F,3F,1F,1F,06
1930 DATA 10,F0,F0,F0,10,10,10,F0
1940 DATA 80,80,90,F0,F0,90,80,00
1950 DATA 02,07,0F,1E,3C,FE,FF,7F
1960 DATA 3F,7F,6F,07,03,07,06,00
1970 DATA 00,00,80,C0,60,30,64,C6
1980 DATA EF,FC,F8,FC,FC,F8,F8,60
1990 DATA 00,01,03,00,04,0E,1B,31
2000 DATA 63,F7,7F,3F,1F,0F,07,06
2010 DATA 80,80,D8,FE,7E,FF,FF,FE
2020 DATA FC,FE,F6,E0,C0,E0,60,00
2030 DATA 00,00,00,00,3C,18,18,7F
2040 DATA 7F,7F,FF,7F,7F,1E,0C,00
2050 DATA 00,00,00,00,FF,8E,8E,BE
2060 DATA FE,FE,FE,FE,FE,78,30,00
2070 DATA 06,1F,1F,3F,7F,7F,3F,1F
2080 DATA 1F,3F,7F,7F,3F,1F,1F,10
2090 DATA 00,80,90,F0,F0,90,80,80
2100 DATA F0,10,10,10,F0,F0,F0,10
2110 DATA 01,01,1B,7F,7E,FF,FF,7F
2120 DATA 3F,7F,6F,07,03,07,06,00
2130 DATA 00,80,C0,00,20,70,D8,8C
2140 DATA C6,EF,FE,FC,F8,F0,E0,60
2150 DATA 00,00,01,03,06,0C,26,63
2160 DATA F7,3F,1F,3F,3F,1F,1F,06
2170 DATA 40,E0,F0,78,3C,7F,FF,FE
2180 DATA FC,FE,F6,E0,C0,E0,60,00
2190 DATA FF,FF,C0,C0,C0,C0,C0,C0
2200 DATA C0,C0,C0,C0,C0,C0,FF,FF
2210 DATA FF,FF,03,03,03,03,03,03
2220 DATA 03,03,03,03,03,03,FF,FF
2230 DATA 08,0E,0F,07,07,07,1F,7F
2240 DATA FF,1F,03,03,07,07,0C,08
2250 DATA 01,03,07,0E,1E,FC,FC,F8
2260 DATA FC,FE,FF,F8,F8,38,18,0B
2270 DATA 22,FF,22,22,22,22,FF,22
2280 DATA 42,42,FF,42,42,42,FF,42
2290 DATA 08,0F,1C,24,E2,72,4D,42
2300 DATA 10,F0,38,24,47,4E,B2,42
2310 DATA 42,B2,4E,47,24,38,F0,10
2320 DATA 42,4D,72,E2,24,1C,0F,O8
2330 DATA 00,00,00,00,00,00,00,00
2340 DATA 42,FF,42,42,42,42,FF,42
2350 DATA 00,22,14,08,1C,2A,08,08
2360 DATA 00,38,2A,3F,3F,12,00,00
2370 DATA 60,78,7E,78,60,40,40,40
2380 DATA ggg,aaa,ggg
2390 DATA gbg,gbg,gbg
2400 DATA ggg,gca,gbg
2410 DATA ggg,adg,gdg
2420 DATA gbg,aeg,ggg
2430 DATA gbg,gfa,ggg
2440 DATA ggg,aca,gbg
2450 DATA gbg,adg,gbg
2460 DATA gbg,aea,ggg
2470 DATA gbg,gfa,gbg
2480 DATA gbg,aca,gbg
2490 DATA ggg,ggg,ggg
2500 DATA gbi,aha,gbg
2510 DATA gpg,aaa,ggg
2520 DATA gbg,gbp,gbg
2530 DATA BD00060D03,20600A3BE1,1B1BB15041,1BE20C00D1,1B5C07BBB1,1BB500B0007,5000000D04
2540 DATA 6,2,17,21,-1,0,23,12,-1,0
2550 DATA 2006000003,E20A00003E,11B1EBBBE1,9C08CD60C7,11BB1B1B11,150080A041,500D008004
2560 DATA 6,2,8,21,-1,0,23,6,-,1,0
2570 DATA 2600000D23,11206D0311,1112C03111,E1111B1111,1E158D4111,158000C41,50000008D4
2580 DATA 6,3,14,21,1,0,8,3,1,0,23,12,0,1
2590 DATA 2060606063,1BEBEB1B11,90A0CDA07E,1B1B1B90CD,90ADA0C07E,1B1B1B1B11,5080808084
2600 DATA 7,3,14,18,0,-1,21,21,1,0,11,3,-1,0
2610 DATA 26D6666063,9C0CACCDC7,9CDCCCC0C7,9C0CCACDC7,9CDCCCC0C7,9C0CCCCDA7,58D888084
2620 DATA 7,3,20,17,0,-1,15,9,1,0,8,18,-1,0
2630 DATA 2320D06003,1E12008031,9CAC06D3E1,11150A0CC7,11500C0411,E5000A0041,50000800D4
2640 DATA 6,4,8,21,1,0,26,15,0,1,2,15,0,1,14,9,-1,0
2650 DATA BEB1B2DB1B,0A0C0800CD,B1B1B200CD,2CA0A00A0,11B1BEBB1B,11B1B1BB1B,E50808008D
2660 DATA 7,4,2,15,0,-1,2,18,0,1,29,21,-1,0,23,6,-1,0
2670 DATA 200000600B,900000C003,1D0060C0DE,9000A0A0D0,1D0080C0DE,9000008004,50000000DB
2680 DATA 8,4,26,3,-1,0,12,3,1,0,23,9,-1,0,12,18,1,0
2690 DATA B20DEED03B,B1D0AA0D1B,DA0D1ED0AD,DA00A000AD,DA0D1ED0AD,B1D0AA0D1B,B50DEED04B
2700 DATA 24,3,20,12,1,0,9,12,1,0,23,21,-1,0
2710 DATA 2000000003,1200000D67,11B2000311,11DC000711,1908000411,150000004E,5000000004
2720 DATA 3,4,29,15,0,-1,17,6,-1,0,14,12,-1,0,17,15,1,0

OK the above is the new fixes...it reaches up to displaying the stage but goes error in line 480 illegal out of range. There is a graphics glitches displaying the stage and error in the string above. I have posted the screenshot below. Now I am sure the issue is with the data itself. If someone can look at the data for me it will be greatly appreciate it.


d6 dice roller

By Briqunullus

Champion (428)

Briqunullus's picture

29-10-2021, 09:20

Sorry, I can't find this one. I have run the program and I get the same error message. The problem is that PT(W) is -60. It should be positive. PT is calculated in 1450. You could check this line and a few lines before that. It also uses data values from (I think) lines 2540, 2560 and so on. You could have a look at those as well.

In line 1600, please type POINTS, TIME and STEPS in upper case.

However, as you have noticed, typing listings is tough. Mistakes happen, no matter how carefully you are typing. Most magazines back in the day had listing checkers. Every line would have a checksum. If the checksum doesn't match, you have modified that line.

By Jipe

Paragon (1515)

Jipe's picture

29-10-2021, 10:27

for glitch replace
1660 locate m*3+1,n*3+2:print p$(a,1)
by
1660 locate m*3+1,n*3+3:print p$(a,1)

By foody

Champion (325)

foody's picture

29-10-2021, 19:35

Thank you guys both for all the help! This is the code right now with the new changes. However, there is still some runtime bug. Occasional game freeze, plus when the train falls off the track it falls down and then comes back from the top screen to fall down again endlessly without losing a life or restarting the level. This is the new with the changes that you guys helped me.

 140 clear 5000:DEFINT a-z:key OFF
150 color 15,1,1:SCREEN 1,2:width 32
160 deffnq$(a,b)=right$("00000"+mid$(str$(a),2,len(str$(a))-1),b)
170 dim p$(14,2)
180 for n=1 to 10:b$=""
190 for m=0 to 31:read a$
200 b$=b$+chr$(val("&H"+a$)):NEXT
210 sprite$(n)=b$:NEXT
220 for n=776 to 855:read A$
230 a=val("&H"+A$):vpoke n,a:NEXT
240 for n=896 to 903:read A$
250 a=val("&H"+a$):vpoke n,a:NEXT
260 vpoke 8204,26:vpoke 8205,26
270 vpoke 8206,202
280 for n=0 to 14:for m=0 to 2
290 read p$(n,m):next m,N
300 CLS
310 locate 6,4:print string$(20,112)
320 print tab(6);"p RAILROAD         p"
330 PRINT TAB(6);STRING$(20,112)
340 LOCATE 0,9:PRINT STRING$(160,103)
350 LOCATE 0,11:PRINT STRING$(32,97)
360 LOCATE 10,10:PRINT CHR$(105)
370 LOCATE 3,22:PRINT " PRESS SPACEBAR TO BEGIN "
380 M=0:FOR N=0 TO 1000:NEXT
390 M=M+1:PUT SPRITE 1,(M,78),4,1
400 FOR JS=0 TO 2:I=STRIG(JS)
410 IF I THEN 430
420 NEXT:GOTO 390
430 GOSUB 1570
440 RESTORE 2530:FA=1:PO=0:VI=3
450 GOSUB 1600:TE=999
460 FOR W=1 TO NT
470 IF W=1 THEN CO=1 ELSE CO=4
480 PUT SPRITE W+1,(X(W)*8,Y(W)*8-9),CO,PT(W)
490 FOR N=2 TO NT
500 IF X(1)=X(N) AND Y(1)=Y(N) THEN GOTO 1330
510 NEXT N 
520 GOSUB 700
530 NEXT W 
540 LOCATE 20,0:TE=TE-1:PRINT FNQ$(TE,3)
550 IF TE=0 THEN GOSUB 1570:GOTO 1490
560 ED=X(1)+Y(1)*32+6144
570 IF VPEEK(ED+1)=112 THEN VPOKE ED+1,103:GOSUB 840
580 IF VPEEK(ED-32)=112 THEN VPOKEED-32,103:GOSUB 840
590 I=STICK(JS)
600 IF I=1 THEN CY=CY-3
610 IF I=5 THEN CY=CY+3
620 IF I=3 THEN CX=CX+3
630 IF I=7 THEN CX=CX-3
640 IF CX<2 THEN CX=29
650 IF CX>29 THEN CX=2
660 IF CY<3 THEN CY=21
670 IF CY>21 THEN CY=3
680 PUT SPRITE 1,(CX*8-4, CY*8-5),6,9
690 GOTO 460
700 X(W)=X(W)+FX(W):Y(W)=Y(W)+FY(W)
710 Q(W)=P(W)
720 P(W)=VPEEK(X(W)+Y(W)*32+6144)-97
730 IF P(W)=7 THEN RETURN
740 IF P(W)=Q(W) THEN RETURN
750 IF P(W)=2 AND (FX(W)=-1 OR FY(W)=-1) THEN PT(W)=4-4*FX(W):SWAP FX(W),FY(W):FX(W)=-FX(W):FY(W)=-FY(W):RETURN 
760 IF P(W)=3 AND (FX(W)=1 OR FY(W)=-1) THEN PT(W)=3-4*FY(W):SWAP FX(W), FY(W):RETURN 
770 IF P(W)=4 AND (FX(W)=1 OR FY(W)-1) THEN PT(W)=4+4*FY(W):SWAP FX(W), FY(W):FX(W)=-FX(W):FY(W)=-FY(W)
780 IF P(W)=5 AND (FX(W)=-1 OR FY(W)=1) THEN PT(W)=3-4*FX(W):SWAP FX(W),FY(W):RETURN 
790 IF Q(W)=0 THEN FX(W)=-FX(W):X(W)=X(W)+FX(W)
800 IF Q(W)=1 THEN FY(W)=-FY(W):Y(W)=Y(W)+FY(W)
810 IF P(W)=0 THEN PT(W)=3-2*FX(W)
820 IF P(W)=1 THEN PT(W)=4-2*FY(W)
830 RETURN
840 PO=PO+10
850 LOCATE 8,0:PRINT FNQ$(PO,5)
860 SOUND 7,56, SOUND 10,16:SOUND 13,0
870 SOUND 12,10:SOUND 5,1:SOUND 4,0
880 NB=NB-1
890 IF NB>0 THEN RETURN
900 INTERVAL OFF:STRIG(JS) OFF
910 BEEP:rem PLAY "S0M6000L8CC16C16DCEF2"
920 IF PLAY(0) THEN 920
930 GOSUB 1570
940 LOCATE 10,11:PRINT "                "
950 LOCATE 10,12:PRINT " HAPPY BIRTHDAY "
960 LOCATE 10,13:PRINT "                "
970 FOR N=0 TO 5000:NEXT
980 PLAY "V15L16CFB"
990 LOCATE 10,12:PRINT " BONUS: ";FNQ$(TE,3)
1000 FOR N=0 TO 5000:NEXT
1010 PO=PO+TE
1020 FA=FA+1
1030 IF FA=11 THEN RESTORE 2530
1040 GOTO 450
1050 ED=CX+CY*32+6144
1060 DT=VPEEK(ED)-97:DA=DT
1070 IF DT>5 OR DT<2 THEN RETURN
1080 DN=VPEEK(ED-32)
1090 DS=VPEEK(ED+32)
1100 DL=VPEEK(ED+1)
1110 D0=VPEEK(ED-1)
1120 DT=DT+1:IF DT=6 THEN DT=2
1130 IF DT=DA THEN RETURN
1140 if dt=2 and ds<>103 and dl<>103 then 1190
1150 if dt=3 and ds<>103 and d0<>103 then 1190
1160 if dt=4 and dn<>103 and d0<>103 then 1190
1170 if dt=5 and dn<>103 and dl<>103 then 1190
1180 goto 1120
1190 sound 7,28:sound 6,31:sound 10,16
1200 sound 13,4:sound 12,2
1210 vpoke ed,dt+97:RETURN
1220 SOUND 7,56:mu=mu+1
1230 if mu=9 then mu=1
1240 if mu>7 THEN RETURN
1250 if mu=1 then rem play"V904L4T254AF#8R82R4F#GA","T25403V7DA02A03ADA02A03A"
1260 if mu=2 then rem play "05F#R4F#R4D1","D04D02A04D03DBAF#"
1270 if mu=3 then rem play "04AF#8R8R2R4F#GF#","03DA02A03ADA02A03A"
1280 IF MU=4 THEN rem PLAY "04AR4AR4G1","03C#04C#02A04C#03C#EAB"
1290 if mu=5 then rem play "GE8R8R2R4EF#G","04C#03A02A04C#03C#A02A04C#"
1300 IF MU=6 THEN rem PLAY "AF#8R8R2R4F#G#.F#8","03DA02A03AD04DC2"
1310 IF MU=7 THEN rem PLAY "EAR4F$G#ER4BA1A1","03EA04C#E03EB04DED03BAF#D"
1320 RETURN
1330 INTERVAL off:strig(js) OFf:
1340 beep:sound 7,7:sound 8,16
1350 sound 6,31:sound 13,0:sound 12,60
1360 PUT SPRITE 1,(x(1)*8,y(1)*8-9),6,10
1370 for n=0 to 5000:NEXT
1380 gosub 1570
1390 vi=vi-1
1400 if vi<0 then 1490
1410 for n=1 to nt
1420 x(n)=og(n,1):y(n)=og(n,2)
1430 fx(n)=og(n,3):fy(n)=og(n,4)
1440 p(n)=vpeek(x(n)+y(n)*32+6144)-97
1450 pt(n)=p(n)-2*(fx(n)+fy(n))+3
1460 NEXT
1470 gosub 14780
1480 goto 460
1490 BEEP:INTERVAL OFF:strig(js) OFF
1500 locate 10,11:print "            "
1510 locate 10,12:print "  GAME OVER "
1520 locate 10,13:print "            "
1530 sound 7,56:rem play "V14L32BAGFEDC4"
1540 for n=0 to 2
1550 if strig(n) then 300
1560 next:goto 1540
1570 for n=0 to nt
1580 put SPRITE n+1,(0,0),0,n:NEXT:
1590 return
1600 CLS:PRINT " POINTS:";FNQ$(po,5);" TIME:999 STEPS:";FNQ$(fa,2)
1610 print " ";string$(30,103)
1620 for n=0 to 6
1630 read a$:for m=0 to 9
1640 a=val("&H"+mid$(a$,m+1,1))
1650 locate m*3+1,n*3+2:print p$(a,0)
1660 locate m*3+1,n*3+3:print p$(a,1)
1670 locate m*3+1,n*3+4:print p$(a,2)
1680 next m,N 
1690 read nb,nt:for n=1 to nt
1700 for m=1 to 4
1710 read og(n,m):next m,N
1720 for n=1 to nt
1730 x(n)=og(n,1):y(n)=og(n,2)
1740 fx(n)=og(n,3):fy(n)=og(n,4)
1750 p(n)=vpeek(x(n)+y(n)*32+6144)-97
1760 pt(n)=p(n)-2*(fx(n)+fy(n))+3
1770 NEXT
1780 cx=2:cy=3
1790 locate 13,1
1800 print STRING$(vi,106);chr$(103)
1810 mu=0:gosub 1220
1820 strig(js) ON
1830 on strig gosub 1050,1050,1050
1840 interval ON
1850 on INTERVAL=113 gosub 1120
1860 RETURN
1870 data 00,00,00,00,FF,71,71,71 
1880 DATA 7F,7F,7F,7F,FF,1E,0C,00
1890 DATA 00,00,00,00,3C,18,18,FE
1900 DATA FE,FF,FF,FE,FE,78,30,00
1910 DATA 10,1F,1F,3F,7F,7F,3F,1F
1920 DATA 1F,3F,7F,7F,3F,1F,1F,06
1930 DATA 10,F0,F0,F0,10,10,10,F0
1940 DATA 80,80,90,F0,F0,90,80,00
1950 DATA 02,07,0F,1E,3C,FE,FF,7F
1960 DATA 3F,7F,6F,07,03,07,06,00
1970 DATA 00,00,80,C0,60,30,64,C6
1980 DATA EF,FC,F8,FC,FC,F8,F8,60
1990 DATA 00,01,03,00,04,0E,1B,31
2000 DATA 63,F7,7F,3F,1F,0F,07,06
2010 DATA 80,80,D8,FE,7E,FF,FF,FE
2020 DATA FC,FE,F6,E0,C0,E0,60,00
2030 DATA 00,00,00,00,3C,18,18,7F
2040 DATA 7F,7F,FF,7F,7F,1E,0C,00
2050 DATA 00,00,00,00,FF,8E,8E,BE
2060 DATA FE,FE,FE,FE,FE,78,30,00
2070 DATA 06,1F,1F,3F,7F,7F,3F,1F
2080 DATA 1F,3F,7F,7F,3F,1F,1F,10
2090 DATA 00,80,90,F0,F0,90,80,80
2100 DATA F0,10,10,10,F0,F0,F0,10
2110 DATA 01,01,1B,7F,7E,FF,FF,7F
2120 DATA 3F,7F,6F,07,03,07,06,00
2130 DATA 00,80,C0,00,20,70,D8,8C
2140 DATA C6,EF,FE,FC,F8,F0,E0,60
2150 DATA 00,00,01,03,06,0C,26,63
2160 DATA F7,3F,1F,3F,3F,1F,1F,06
2170 DATA 40,E0,F0,78,3C,7F,FF,FE
2180 DATA FC,FE,F6,E0,C0,E0,60,00
2190 DATA FF,FF,C0,C0,C0,C0,C0,C0
2200 DATA C0,C0,C0,C0,C0,C0,FF,FF
2210 DATA FF,FF,03,03,03,03,03,03
2220 DATA 03,03,03,03,03,03,FF,FF
2230 DATA 08,0E,0F,07,07,07,1F,7F
2240 DATA FF,1F,03,03,07,07,0C,08
2250 DATA 01,03,07,0E,1E,FC,FC,F8
2260 DATA FC,FE,FF,F8,F8,38,18,0B
2270 DATA 22,FF,22,22,22,22,FF,22
2280 DATA 42,42,FF,42,42,42,FF,42
2290 DATA 08,0F,1C,24,E2,72,4D,42
2300 DATA 10,F0,38,24,47,4E,B2,42
2310 DATA 42,B2,4E,47,24,38,F0,10
2320 DATA 42,4D,72,E2,24,1C,0F,O8 
2330 DATA 00,00,00,00,00,00,00,00
2340 DATA 42,FF,42,42,42,42,FF,42
2350 DATA 00,22,14,08,1C,2A,08,08
2360 DATA 00,38,2A,3F,3F,12,00,00
2370 DATA 60,78,7E,78,60,40,40,40
2380 DATA ggg,aaa,ggg
2390 DATA gbg,gbg,gbg
2400 DATA ggg,gca,gbg
2410 DATA ggg,adg,gdg
2420 DATA gbg,aeg,ggg
2430 DATA gbg,gfa,ggg
2440 DATA ggg,aca,gbg
2450 DATA gbg,adg,gbg
2460 DATA gbg,aea,ggg
2470 DATA gbg,gfa,gbg
2480 DATA gbg,aca,gbg
2490 DATA ggg,ggg,ggg
2500 DATA gbi,aha,gbg
2510 DATA gpg,aaa,ggg
2520 DATA gbg,gbp,gbg
2530 DATA BD00060D03,20600A3BE1,1B1BB15041,1BE20C00D1,1B5C07BBB1,1BB500B0007,5000000D04
2540 DATA 6,2,17,21,-1,0,23,12,-1,0
2550 DATA 2006000003,E20A00003E,11B1EBBBE1,9C08CD60C7,11BB1B1B11,150080A041,500D008004
2560 DATA 6,2,8,21,-1,0,23,6,-,1,0
2570 DATA 2600000D23,11206D0311,1112C03111,E1111B1111,1E158D4111,158000C41,50000008D4
2580 DATA 6,3,14,21,1,0,8,3,1,0,23,12,0,1
2590 DATA 2060606063,1BEBEB1B11,90A0CDA07E,1B1B1B90CD,90ADA0C07E,1B1B1B1B11,5080808084
2600 DATA 7,3,14,18,0,-1,21,21,1,0,11,3,-1,0
2610 DATA 26D6666063,9C0CACCDC7,9CDCCCC0C7,9C0CCACDC7,9CDCCCC0C7,9C0CCCCDA7,58D888084
2620 DATA 7,3,20,17,0,-1,15,9,1,0,8,18,-1,0
2630 DATA 2320D06003,1E12008031,9CAC06D3E1,11150A0CC7,11500C0411,E5000A0041,50000800D4
2640 DATA 6,4,8,21,1,0,26,15,0,1,2,15,0,1,14,9,-1,0
2650 DATA BEB1B2DB1B,0A0C0800CD,B1B1B200CD,2C0A0A00A0,11B1BEBB1B,11B1B1BB1B,E50808008D
2660 DATA 7,4,2,15,0,-1,2,18,0,1,29,21,-1,0,23,6,-1,0
2670 DATA 200000600B,900000C003,1D0060C0DE,9000A0A0D0,1D0080C0DE,9000008004,50000000DB
2680 DATA 8,4,26,3,-1,0,12,3,1,0,23,9,-1,0,12,18,1,0
2690 DATA B20DEED03B,B1D0AA0D1B,DA0D1ED0AD,DA00A000AD,DA0D1ED0AD,B1D0AA0D1B,B50DEED04B
2700 DATA 24,3,20,12,1,0,9,12,1,0,23,21,-1,0
2710 DATA 2000000003,1200000D67,11B2000311,11DC000711,1908000411,150000004E,5000000004
2720 DATA 3,4,29,15,0,-1,17,6,-1,0,14,12,-1,0,17,15,1,0

By foody

Champion (325)

foody's picture

29-10-2021, 19:40

Here is an example of random freezing


bosler library

By foody

Champion (325)

foody's picture

29-10-2021, 20:10

Here is a video of it freezing and having falling weird behavior

 140 clear 5000:DEFINT a-z:key OFF
150 color 15,1,1:SCREEN 1,2:width 32
160 deffnq$(a,b)=right$("00000"+mid$(str$(a),2,len(str$(a))-1),b)
170 dim p$(14,2)
180 for n=1 to 10:b$=""
190 for m=0 to 31:read a$
200 b$=b$+chr$(val("&H"+a$)):NEXT
210 sprite$(n)=b$:NEXT
220 for n=776 to 855:read A$
230 a=val("&H"+A$):vpoke n,a:NEXT
240 for n=896 to 903:read A$
250 a=val("&H"+a$):vpoke n,a:NEXT
260 vpoke 8204,26:vpoke 8205,26
270 vpoke 8206,202
280 for n=0 to 14:for m=0 to 2
290 read p$(n,m):next m,N
300 CLS
310 locate 6,4:print string$(20,112)
320 print tab(6);"p RAILROAD         p"
330 PRINT TAB(6);STRING$(20,112)
340 LOCATE 0,9:PRINT STRING$(160,103)
350 LOCATE 0,11:PRINT STRING$(32,97)
360 LOCATE 10,10:PRINT CHR$(105)
370 LOCATE 3,22:PRINT " PRESS SPACEBAR TO BEGIN "
380 M=0:FOR N=0 TO 1000:NEXT
390 M=M+1:PUT SPRITE 1,(M,78),4,1
400 FOR JS=0 TO 2:I=STRIG(JS)
410 IF I THEN 430
420 NEXT:GOTO 390
430 GOSUB 1570
440 RESTORE 2530:FA=1:PO=0:VI=3
450 GOSUB 1600:TE=999
460 FOR W=1 TO NT
470 IF W=1 THEN CO=1 ELSE CO=4
480 PUT SPRITE W+1,(X(W)*8,Y(W)*8-9),CO,PT(W)
490 FOR N=2 TO NT
500 IF X(1)=X(N) AND Y(1)=Y(N) THEN GOTO 1330
510 NEXT N 
520 GOSUB 700
530 NEXT W 
540 LOCATE 20,0:TE=TE-1:PRINT FNQ$(TE,3)
550 IF TE=0 THEN GOSUB 1570:GOTO 1490
560 ED=X(1)+Y(1)*32+6144
570 IF VPEEK(ED+1)=112 THEN VPOKE ED+1,103:GOSUB 840
580 IF VPEEK(ED-32)=112 THEN VPOKEED-32,103:GOSUB 840
590 I=STICK(JS)
600 IF I=1 THEN CY=CY-3
610 IF I=5 THEN CY=CY+3
620 IF I=3 THEN CX=CX+3
630 IF I=7 THEN CX=CX-3
640 IF CX<2 THEN CX=29
650 IF CX>29 THEN CX=2
660 IF CY<3 THEN CY=21
670 IF CY>21 THEN CY=3
680 PUT SPRITE 1,(CX*8-4, CY*8-5),6,9
690 GOTO 460
700 X(W)=X(W)+FX(W):Y(W)=Y(W)+FY(W)
710 Q(W)=P(W)
720 P(W)=VPEEK(X(W)+Y(W)*32+6144)-97
730 IF P(W)=7 THEN RETURN
740 IF P(W)=Q(W) THEN RETURN
750 IF P(W)=2 AND (FX(W)=-1 OR FY(W)=-1) THEN PT(W)=4-4*FX(W):SWAP FX(W),FY(W):FX(W)=-FX(W):FY(W)=-FY(W):RETURN 
760 IF P(W)=3 AND (FX(W)=1 OR FY(W)=-1) THEN PT(W)=3-4*FY(W):SWAP FX(W), FY(W):RETURN 
770 IF P(W)=4 AND (FX(W)=1 OR FY(W)=1) THEN PT(W)=4+4*FY(W):SWAP FX(W), FY(W):FX(W)=-FX(W):FY(W)=-FY(W)
780 IF P(W)=5 AND (FX(W)=-1 OR FY(W)=1) THEN PT(W)=3-4*FX(W):SWAP FX(W),FY(W):RETURN 
790 IF Q(W)=0 THEN FX(W)=-FX(W):X(W)=X(W)+FX(W)
800 IF Q(W)=1 THEN FY(W)=-FY(W):Y(W)=Y(W)+FY(W)
810 IF P(W)=0 THEN PT(W)=3-2*FX(W)
820 IF P(W)=1 THEN PT(W)=4-2*FY(W)
830 RETURN
840 PO=PO+10
850 LOCATE 8,0:PRINT FNQ$(PO,5)
860 SOUND 7,56: SOUND 10,16:SOUND 13,0
870 SOUND 12,10:SOUND 5,1:SOUND 4,0
880 NB=NB-1
890 IF NB>0 THEN RETURN
900 INTERVAL OFF:STRIG(JS) OFF
910 BEEP:rem PLAY "S0M6000L8CC16C16DCEF2"
920 IF PLAY(0) THEN 920
930 GOSUB 1570
940 LOCATE 10,11:PRINT "                "
950 LOCATE 10,12:PRINT " HAPPY BIRTHDAY "
960 LOCATE 10,13:PRINT "                "
970 FOR N=0 TO 5000:NEXT
980 rem PLAY "V15L16CFB"
990 LOCATE 10,12:PRINT " BONUS: ";FNQ$(TE,3)
1000 FOR N=0 TO 5000:NEXT
1010 PO=PO+TE
1020 FA=FA+1
1030 IF FA=11 THEN RESTORE 2530
1040 GOTO 450
1050 ED=CX+CY*32+6144
1060 DT=VPEEK(ED)-97:DA=DT
1070 IF DT>5 OR DT<2 THEN RETURN
1080 DN=VPEEK(ED-32)
1090 DS=VPEEK(ED+32)
1100 DL=VPEEK(ED+1)
1110 D0=VPEEK(ED-1)
1120 DT=DT+1:IF DT=6 THEN DT=2
1130 IF DT=DA THEN RETURN
1140 if dt=2 and ds<>103 and dl<>103 then 1190
1150 if dt=3 and ds<>103 and d0<>103 then 1190
1160 if dt=4 and dn<>103 and d0<>103 then 1190
1170 if dt=5 and dn<>103 and dl<>103 then 1190
1180 goto 1120
1190 sound 7,28:sound 6,31:sound 10,16
1200 sound 13,4:sound 12,2
1210 vpoke ed,dt+97:RETURN
1220 SOUND 7,56:mu=mu+1
1230 if mu=9 then mu=1
1240 if mu>7 THEN RETURN
1250 if mu=1 then rem play"V904L4T254AF#8R82R4F#GA","T25403V7DA02A03ADA02A03A"
1260 if mu=2 then rem play "05F#R4F#R4D1","D04D02A04D03DBAF#"
1270 if mu=3 then rem play "04AF#8R8R2R4F#GF#","03DA02A03ADA02A03A"
1280 IF MU=4 THEN rem PLAY "04AR4AR4G1","03C#04C#02A04C#03C#EAB"
1290 if mu=5 then rem play "GE8R8R2R4EF#G","04C#03A02A04C#03C#A02A04C#"
1300 IF MU=6 THEN rem PLAY "AF#8R8R2R4F#G#.F#8","03DA02A03AD04DC2"
1310 IF MU=7 THEN rem PLAY "EAR4F$G#ER4BA1A1","03EA04C#E03EB04DED03BAF#D"
1320 RETURN
1330 INTERVAL off:strig(js) OFf:
1340 beep:sound 7,7:sound 8,16
1350 sound 6,31:sound 13,0:sound 12,60
1360 PUT SPRITE 1,(x(1)*8,y(1)*8-9),6,10
1370 for n=0 to 5000:NEXT
1380 gosub 1570
1390 vi=vi-1
1400 if vi<0 then 1490
1410 for n=1 to nt
1420 x(n)=og(n,1):y(n)=og(n,2)
1430 fx(n)=og(n,3):fy(n)=og(n,4)
1440 p(n)=vpeek(x(n)+y(n)*32+6144)-97
1450 pt(n)=p(n)-2*(fx(n)+fy(n))+3
1460 NEXT
1470 gosub 14780
1480 goto 460
1490 BEEP:INTERVAL OFF:strig(js) OFF
1500 locate 10,11:print "            "
1510 locate 10,12:print "  GAME OVER "
1520 locate 10,13:print "            "
1530 sound 7,56:rem play "V14L32BAGFEDC4"
1540 for n=0 to 2
1550 if strig(n) then 300
1560 next:goto 1540
1570 for n=0 to nt
1580 put SPRITE n+1,(0,0),0,n:NEXT:
1590 return
1600 CLS:PRINT " POINTS:";FNQ$(po,5);" TIME:999 STEPS:";FNQ$(fa,2)
1610 print " ";string$(30,103)
1620 for n=0 to 6
1630 read a$:for m=0 to 9
1640 a=val("&H"+mid$(a$,m+1,1))
1650 locate m*3+1,n*3+2:print p$(a,0)
1660 locate m*3+1,n*3+3:print p$(a,1)
1670 locate m*3+1,n*3+4:print p$(a,2)
1680 next m,N 
1690 read nb,nt:for n=1 to nt
1700 for m=1 to 4
1710 read og(n,m):next m,N
1720 for n=1 to nt
1730 x(n)=og(n,1):y(n)=og(n,2)
1740 fx(n)=og(n,3):fy(n)=og(n,4)
1750 p(n)=vpeek(x(n)+y(n)*32+6144)-97
1760 pt(n)=p(n)-2*(fx(n)+fy(n))+3
1770 NEXT
1780 cx=2:cy=3
1790 locate 13,1
1800 print STRING$(vi,106);chr$(103)
1810 mu=0:gosub 1220
1820 strig(js) ON
1830 on strig gosub 1050,1050,1050
1840 interval ON
1850 on INTERVAL=113 gosub 1120
1860 RETURN
1870 data 00,00,00,00,FF,71,71,71 
1880 DATA 7F,7F,7F,7F,FF,1E,0C,00
1890 DATA 00,00,00,00,3C,18,18,FE
1900 DATA FE,FF,FF,FE,FE,78,30,00
1910 DATA 10,1F,1F,3F,7F,7F,3F,1F
1920 DATA 1F,3F,7F,7F,3F,1F,1F,06
1930 DATA 10,F0,F0,F0,10,10,10,F0
1940 DATA 80,80,90,F0,F0,90,80,00
1950 DATA 02,07,0F,1E,3C,FE,FF,7F
1960 DATA 3F,7F,6F,07,03,07,06,00
1970 DATA 00,00,80,C0,60,30,64,C6
1980 DATA EF,FC,F8,FC,FC,F8,F8,60
1990 DATA 00,01,03,00,04,0E,1B,31
2000 DATA 63,F7,7F,3F,1F,0F,07,06
2010 DATA 80,80,D8,FE,7E,FF,FF,FE
2020 DATA FC,FE,F6,E0,C0,E0,60,00
2030 DATA 00,00,00,00,3C,18,18,7F
2040 DATA 7F,7F,FF,7F,7F,1E,0C,00
2050 DATA 00,00,00,00,FF,8E,8E,BE
2060 DATA FE,FE,FE,FE,FE,78,30,00
2070 DATA 06,1F,1F,3F,7F,7F,3F,1F
2080 DATA 1F,3F,7F,7F,3F,1F,1F,10
2090 DATA 00,80,90,F0,F0,90,80,80
2100 DATA F0,10,10,10,F0,F0,F0,10
2110 DATA 01,01,1B,7F,7E,FF,FF,7F
2120 DATA 3F,7F,6F,07,03,07,06,00
2130 DATA 00,80,C0,00,20,70,D8,8C
2140 DATA C6,EF,FE,FC,F8,F0,E0,60
2150 DATA 00,00,01,03,06,0C,26,63
2160 DATA F7,3F,1F,3F,3F,1F,1F,06
2170 DATA 40,E0,F0,78,3C,7F,FF,FE
2180 DATA FC,FE,F6,E0,C0,E0,60,00
2190 DATA FF,FF,C0,C0,C0,C0,C0,C0
2200 DATA C0,C0,C0,C0,C0,C0,FF,FF
2210 DATA FF,FF,03,03,03,03,03,03
2220 DATA 03,03,03,03,03,03,FF,FF
2230 DATA 08,0E,0F,07,07,07,1F,7F
2240 DATA FF,1F,03,03,07,07,0C,08
2250 DATA 01,03,07,0E,1E,FC,FC,F8
2260 DATA FC,FE,FF,F8,F8,38,18,0B
2270 DATA 22,FF,22,22,22,22,FF,22
2280 DATA 42,42,FF,42,42,42,FF,42
2290 DATA 08,0F,1C,24,E2,72,4D,42
2300 DATA 10,F0,38,24,47,4E,B2,42
2310 DATA 42,B2,4E,47,24,38,F0,10
2320 DATA 42,4D,72,E2,24,1C,0F,O8 
2330 DATA 00,00,00,00,00,00,00,00
2340 DATA 42,FF,42,42,42,42,FF,42
2350 DATA 00,22,14,08,1C,2A,08,08
2360 DATA 00,38,2A,3F,3F,12,00,00
2370 DATA 60,78,7E,78,60,40,40,40
2380 DATA ggg,aaa,ggg
2390 DATA gbg,gbg,gbg
2400 DATA ggg,gca,gbg
2410 DATA ggg,adg,gdg
2420 DATA gbg,aeg,ggg
2430 DATA gbg,gfa,ggg
2440 DATA ggg,aca,gbg
2450 DATA gbg,adg,gbg
2460 DATA gbg,aea,ggg
2470 DATA gbg,gfa,gbg
2480 DATA gbg,aca,gbg
2490 DATA ggg,ggg,ggg
2500 DATA gbi,aha,gbg
2510 DATA gpg,aaa,ggg
2520 DATA gbg,gbp,gbg
2530 DATA BD00060D03,20600A3BE1,1B1BB15041,1BE20C00D1,1B5C07BBB1,1BB500B0007,5000000D04
2540 DATA 6,2,17,21,-1,0,23,12,-1,0
2550 DATA 2006000003,E20A00003E,11B1EBBBE1,9C08CD60C7,11BB1B1B11,150080A041,500D008004
2560 DATA 6,2,8,21,-1,0,23,6,-,1,0
2570 DATA 2600000D23,11206D0311,1112C03111,E1111B1111,1E158D4111,158000C41,50000008D4
2580 DATA 6,3,14,21,1,0,8,3,1,0,23,12,0,1
2590 DATA 2060606063,1BEBEB1B11,90A0CDA07E,1B1B1B90CD,90ADA0C07E,1B1B1B1B11,5080808084
2600 DATA 7,3,14,18,0,-1,21,21,1,0,11,3,-1,0
2610 DATA 26D6666063,9C0CACCDC7,9CDCCCC0C7,9C0CCACDC7,9CDCCCC0C7,9C0CCCCDA7,58D888084
2620 DATA 7,3,20,17,0,-1,15,9,1,0,8,18,-1,0
2630 DATA 2320D06003,1E12008031,9CAC06D3E1,11150A0CC7,11500C0411,E5000A0041,50000800D4
2640 DATA 6,4,8,21,1,0,26,15,0,1,2,15,0,1,14,9,-1,0
2650 DATA BEB1B2DB1B,0A0C0800CD,B1B1B200CD,2C0A0A00A0,11B1BEBB1B,11B1B1BB1B,E50808008D
2660 DATA 7,4,2,15,0,-1,2,18,0,1,29,21,-1,0,23,6,-1,0
2670 DATA 200000600B,900000C003,1D0060C0DE,9000A0A0D0,1D0080C0DE,9000008004,50000000DB
2680 DATA 8,4,26,3,-1,0,12,3,1,0,23,9,-1,0,12,18,1,0
2690 DATA B20DEED03B,B1D0AA0D1B,DA0D1ED0AD,DA00A000AD,DA0D1ED0AD,B1D0AA0D1B,B50DEED04B
2700 DATA 24,3,20,12,1,0,9,12,1,0,23,21,-1,0
2710 DATA 2000000003,1200000D67,11B2000311,11DC000711,1908000411,150000004E,5000000004
2720 DATA 3,4,29,15,0,-1,17,6,-1,0,14,12,-1,0,17,15,1,0

By foody

Champion (325)

foody's picture

29-10-2021, 20:10

By chalky

Resident (61)

chalky's picture

30-10-2021, 01:05

There are several issues with your code (e.g. errors in DATA statements, a GOSUB to a non-existing line). I must admit the PDF scan is incredibly difficult to read in places. I have made several changes to the code, and the 1st level now loads and plays correctly.

The train moving up when it shouldn't was caused by errors in the tile data and lines 1840-1850. You will notice that I have commented these lines out as they update the screen (layout) for no apparent reason (using a variable which is not updated before being used).

An error in the level data for level 1 meant it was impossible to finish - so I have corrected it. There may well still be errors in the definitions of other levels - but at least the main program now works better than before...

140 CLEAR 5000:DEFINT A-Z:KEY OFF
150 COLOR 15,1,1:SCREEN 1,2:WIDTH 32
160 DEFFNQ$(A,B)=RIGHT$("00000"+MID$(STR$(A),2,LEN(STR$(A))-1),B)
170 DIM P$(14,2)
180 FOR N=1 TO 10:B$=""
190 FOR M=0 TO 31:READ A$
200 B$=B$+CHR$(VAL("&H"+A$)):NEXT
210 SPRITE$(N)=B$:NEXT
220 FOR N=776 TO 855:READ A$
230 A=VAL("&H"+A$):VPOKE N,A:NEXT
240 FOR N=896 TO 903:READ A$
250 A=VAL("&H"+A$):VPOKE N,A:NEXT
260 VPOKE 8204,26:VPOKE 8205,26
270 VPOKE 8206,202
280 FOR N=0 TO 14:FOR M=0 TO 2
290 READ P$(N,M):NEXT M,N
300 CLS
310 LOCATE 6,4:PRINT STRING$(20,112)
320 PRINT TAB(6);"p     RAILROAD     p"
330 PRINT TAB(6);STRING$(20,112)
340 LOCATE 0,9:PRINT STRING$(160,103)
350 LOCATE 0,11:PRINT STRING$(32,97)
360 LOCATE 10,10:PRINT CHR$(105)
370 LOCATE 3,22:PRINT " PRESS SPACEBAR TO BEGIN "
380 M=0:FOR N=0 TO 1000:NEXT
390 M=M+1:PUT SPRITE 1,(M,78),4,1
400 FOR JS=0 TO 2:I=STRIG(JS)
410 IF I THEN 430
420 NEXT:GOTO 390
430 GOSUB 1570
440 RESTORE 2530:FA=1:PO=0:VI=3
450 GOSUB 1600:TE=999
460 FOR W=1 TO NT
470 IF W=1 THEN CO=1 ELSE CO=4
480 PUT SPRITE W+1,(X(W)*8,Y(W)*8-9),CO,PT(W)
490 FOR N=2 TO NT
500 IF X(1)=X(N) AND Y(1)=Y(N) THEN GOTO 1330
510 NEXT N 
520 GOSUB 700
530 NEXT W 
540 LOCATE 19,0:TE=TE-1:PRINT FNQ$(TE,3)
550 IF TE=0 THEN GOSUB 1570:GOTO 1490
560 ED=X(1)+Y(1)*32+6144
570 IF VPEEK(ED+1)=112 THEN VPOKE ED+1,103:GOSUB 840
580 IF VPEEK(ED-32)=112 THEN VPOKEED-32,103:GOSUB 840
590 I=STICK(JS)
600 IF I=1 THEN CY=CY-3
610 IF I=5 THEN CY=CY+3
620 IF I=3 THEN CX=CX+3
630 IF I=7 THEN CX=CX-3
640 IF CX<2 THEN CX=29
650 IF CX>29 THEN CX=2
660 IF CY<3 THEN CY=21
670 IF CY>21 THEN CY=3
680 PUT SPRITE 1,(CX*8-4, CY*8-5),6,9
690 GOTO 460
700 X(W)=X(W)+FX(W):Y(W)=Y(W)+FY(W)
710 Q(W)=P(W)
720 P(W)=VPEEK(X(W)+Y(W)*32+6144)-97
730 IF P(W)=7 THEN RETURN
740 IF P(W)=Q(W) THEN RETURN
750 IF P(W)=2 AND (FX(W)=-1 OR FY(W)=-1) THEN PT(W)=4-4*FX(W):SWAP FX(W),FY(W):FX(W)=-FX(W):FY(W)=-FY(W):RETURN 
760 IF P(W)=3 AND (FX(W)=1 OR FY(W)=-1) THEN PT(W)=3-4*FY(W):SWAP FX(W), FY(W):RETURN 
770 IF P(W)=4 AND (FX(W)=1 OR FY(W)=1) THEN PT(W)=4+4*FY(W):SWAP FX(W), FY(W):FX(W)=-FX(W):FY(W)=-FY(W)
780 IF P(W)=5 AND (FX(W)=-1 OR FY(W)=1) THEN PT(W)=3-4*FX(W):SWAP FX(W),FY(W):RETURN 
790 IF Q(W)=0 THEN FX(W)=-FX(W):X(W)=X(W)+FX(W)
800 IF Q(W)=1 THEN FY(W)=-FY(W):Y(W)=Y(W)+FY(W)
810 IF P(W)=0 THEN PT(W)=3-2*FX(W)
820 IF P(W)=1 THEN PT(W)=4-2*FY(W)
830 RETURN
840 PO=PO+10
850 LOCATE 8,0:PRINT FNQ$(PO,5)
860 SOUND 7,56: SOUND 10,16:SOUND 13,0
870 SOUND 12,10:SOUND 5,1:SOUND 4,0
880 NB=NB-1
890 IF NB>0 THEN RETURN
900 INTERVAL OFF:STRIG(JS) OFF
910 BEEP:REM PLAY "S0M6000L8CC16C16DCEF2"
920 IF PLAY(0) THEN 920
930 GOSUB 1570
940 LOCATE 10,11:PRINT "                "
950 LOCATE 10,12:PRINT "   WELL DONE!   "
960 LOCATE 10,13:PRINT "                "
970 FOR N=0 TO 5000:NEXT
980 REM PLAY "V15L16CFB"
990 LOCATE 10,12:PRINT " BONUS: ";FNQ$(TE,3);"  "
1000 FOR N=0 TO 5000:NEXT
1010 PO=PO+TE
1020 FA=FA+1
1030 IF FA=11 THEN RESTORE 2530
1040 GOTO 450
1050 ED=CX+CY*32+6144
1060 DT=VPEEK(ED)-97:DA=DT
1070 IF DT>5 OR DT<2 THEN RETURN
1080 DN=VPEEK(ED-32)
1090 DS=VPEEK(ED+32)
1100 DL=VPEEK(ED+1)
1110 D0=VPEEK(ED-1)
1120 DT=DT+1:IF DT=6 THEN DT=2
1130 IF DT=DA THEN RETURN
1140 IF DT=2 AND DS<>103 AND DL<>103 THEN 1190
1150 IF DT=3 AND DS<>103 AND D0<>103 THEN 1190
1160 IF DT=4 AND DN<>103 AND D0<>103 THEN 1190
1170 IF DT=5 AND DN<>103 AND DL<>103 THEN 1190
1180 GOTO 1120
1190 SOUND 7,28:SOUND 6,31:SOUND 10,16
1200 SOUND 13,4:SOUND 12,2
1210 VPOKE ED,DT+97:RETURN
1220 SOUND 7,56:MU=MU+1
1230 IF MU=9 THEN MU=1
1240 IF MU>7 THEN RETURN
1250 IF MU=1 THEN REM PLAY "V904L4T254AF#8R82R4F#GA","T25403V7DA02A03ADA02A03A"
1260 IF MU=2 THEN REM PLAY "05F#R4F#R4D1","D04D02A04D03DBAF#"
1270 IF MU=3 THEN REM PLAY "04AF#8R8R2R4F#GF#","03DA02A03ADA02A03A"
1280 IF MU=4 THEN REM PLAY "04AR4AR4G1","03C#04C#02A04C#03C#EAB"
1290 IF MU=5 THEN REM PLAY "GE8R8R2R4EF#G","04C#03A02A04C#03C#A02A04C#"
1300 IF MU=6 THEN REM PLAY "AF#8R8R2R4F#G#.F#8","03DA02A03AD04DC2"
1310 IF MU=7 THEN REM PLAY "EAR4F$G#ER4BA1A1","03EA04C#E03EB04DED03BAF#D"
1320 RETURN
1330 INTERVAL OFF:STRIG(JS) OFF
1340 BEEP:SOUND 7,7:SOUND 8,16
1350 SOUND 6,31:SOUND 13,0:SOUND 12,60
1360 PUT SPRITE 1,(X(1)*8,Y(1)*8-9),6,10
1370 FOR N=0 TO 5000:NEXT
1380 GOSUB 1570
1390 VI=VI-1
1400 IF VI<0 THEN 1490
1410 FOR N=1 TO NT
1420 X(N)=OG(N,1):Y(N)=OG(N,2)
1430 FX(N)=OG(N,3):FY(N)=OG(N,4)
1440 P(N)=VPEEK(X(N)+Y(N)*32+6144)-97
1450 PT(N)=P(N)-2*(FX(N)+FY(N))+3
1460 NEXT
1470 GOSUB 1780
1480 GOTO 460
1490 BEEP:INTERVAL OFF:STRIG(JS) OFF
1500 LOCATE 10,11:PRINT "            "
1510 LOCATE 10,12:PRINT "  GAME OVER "
1520 LOCATE 10,13:PRINT "            "
1530 SOUND 7,56:REM PLAY "V14L32BAGFEDC4"
1540 FOR N=0 TO 2
1550 IF STRIG(N) THEN 300
1560 NEXT:GOTO 1540
1570 FOR N=0 TO NT
1580 PUT SPRITE N+1,(0,0),0,N:NEXT:
1590 RETURN
1600 CLS:PRINT " POINTS:";FNQ$(PO,5);" TIME:999 STEPS:";FNQ$(FA,2)
1610 PRINT " ";STRING$(30,103)
1620 FOR N=0 TO 6
1630 READ A$:FOR M=0 TO 9
1640 A=VAL("&H"+MID$(A$,M+1,1))
1650 LOCATE M*3+1,N*3+2:PRINT P$(A,0)
1660 LOCATE M*3+1,N*3+3:PRINT P$(A,1)
1670 LOCATE M*3+1,N*3+4:PRINT P$(A,2)
1680 NEXT M,N 
1690 READ NB,NT:FOR N=1 TO NT
1700 FOR M=1 TO 4
1710 READ OG(N,M):NEXT M,N
1720 FOR N=1 TO NT
1730 X(N)=OG(N,1):Y(N)=OG(N,2)
1740 FX(N)=OG(N,3):FY(N)=OG(N,4)
1750 P(N)=VPEEK(X(N)+Y(N)*32+6144)-97
1760 PT(N)=P(N)-2*(FX(N)+FY(N))+3
1770 NEXT
1780 CX=2:CY=3
1790 LOCATE 13,1
1800 PRINT STRING$(VI,106);CHR$(103)
1810 MU=0:GOSUB 1220
1820 STRIG(JS) ON
1830 ON STRIG GOSUB 1050,1050,1050
1840 REM INTERVAL ON
1850 REM ON INTERVAL=113 GOSUB 1120
1860 RETURN
1870 DATA 00,00,00,00,FF,71,71,71 
1880 DATA 7F,7F,7F,7F,FF,1E,0C,00
1890 DATA 00,00,00,00,3C,18,18,FE
1900 DATA FE,FF,FF,FE,FE,78,30,00
1910 DATA 10,1F,1F,3F,7F,7F,3F,1F
1920 DATA 1F,3F,7F,7F,3F,1F,1F,06
1930 DATA 10,F0,F0,F0,10,10,10,F0
1940 DATA 80,80,90,F0,F0,90,80,00
1950 DATA 02,07,0F,1E,3C,FE,FF,7F
1960 DATA 3F,7F,6F,07,03,07,06,00
1970 DATA 00,00,80,C0,60,30,64,C6
1980 DATA EF,FC,F8,FC,FC,F8,F8,60
1990 DATA 00,01,03,00,04,0E,1B,31
2000 DATA 63,F7,7F,3F,1F,0F,07,06
2010 DATA 80,80,D8,FE,7E,FF,FF,FE
2020 DATA FC,FE,F6,E0,C0,E0,60,00
2030 DATA 00,00,00,00,3C,18,18,7F
2040 DATA 7F,7F,FF,7F,7F,1E,0C,00
2050 DATA 00,00,00,00,FF,8E,8E,BE
2060 DATA FE,FE,FE,FE,FE,78,30,00
2070 DATA 06,1F,1F,3F,7F,7F,3F,1F
2080 DATA 1F,3F,7F,7F,3F,1F,1F,10
2090 DATA 00,80,90,F0,F0,90,80,80
2100 DATA F0,10,10,10,F0,F0,F0,10
2110 DATA 01,01,1B,7F,7E,FF,FF,7F
2120 DATA 3F,7F,6F,07,03,07,06,00
2130 DATA 00,80,C0,00,20,70,D8,8C
2140 DATA C6,EF,FE,FC,F8,F0,E0,60
2150 DATA 00,00,01,03,06,0C,26,63
2160 DATA F7,3F,1F,3F,3F,1F,1F,06
2170 DATA 40,E0,F0,78,3C,7F,FF,FE
2180 DATA FC,FE,F6,E0,C0,E0,60,00
2190 DATA FF,FF,C0,C0,C0,C0,C0,C0
2200 DATA C0,C0,C0,C0,C0,C0,FF,FF
2210 DATA FF,FF,03,03,03,03,03,03
2220 DATA 03,03,03,03,03,03,FF,FF
2230 DATA 08,0F,0F,07,07,07,1F,7F
2240 DATA FF,1F,03,03,07,07,0C,08
2250 DATA 01,03,07,0E,1E,FC,FC,F8
2260 DATA FC,FE,FF,F8,F8,38,18,08
2270 DATA 22,FF,22,22,22,22,FF,22
2280 DATA 42,42,FF,42,42,42,FF,42
2290 DATA 08,0F,1C,24,E2,72,4D,42
2300 DATA 10,F0,38,24,47,4E,B2,42
2310 DATA 42,B2,4E,47,24,38,F0,10
2320 DATA 42,4D,72,E2,24,1C,0F,08 
2330 DATA 00,00,00,00,00,00,00,00
2340 DATA 42,FF,42,42,42,42,FF,42
2350 DATA 00,22,14,08,1C,2A,08,08
2360 DATA 00,38,2A,3F,3F,12,00,00
2370 DATA 60,78,7E,78,60,40,40,40
2380 DATA ggg,aaa,ggg
2390 DATA gbg,gbg,gbg
2400 DATA ggg,gca,gbg
2410 DATA ggg,adg,gbg
2420 DATA gbg,aeg,ggg
2430 DATA gbg,gfa,ggg
2440 DATA ggg,aca,gbg
2450 DATA gbg,adg,gbg
2460 DATA gbg,aea,ggg
2470 DATA gbg,gfa,gbg
2480 DATA gbg,aca,gbg
2490 DATA ggg,ggg,ggg
2500 DATA gbi,aha,gbg
2510 DATA gpg,aaa,ggg
2520 DATA gbg,gbp,gbg
2530 DATA BD00060D03,20600A3BE1,1B1BB15041,1BE20C00D1,1B5C07BBB1,1BB5080007,5000000D04
2540 DATA 6,2,17,21,-1,0,23,12,-1,0
2550 DATA 2006000003,E20A00003E,11B1EBBBE1,9C08CD60C7,11BB1B1B11,150080A041,500D008004
2560 DATA 6,2,8,21,-1,0,23,6,-,1,0
2570 DATA 2600000D23,11206D0311,1112C03111,E1111B1111,1E158D4111,1580000C41,50000008D4
2580 DATA 6,3,14,21,1,0,8,3,1,0,23,12,0,1
2590 DATA 2060606063,1BEBEB1B11,90A0CDA07E,1B1B1B90CD,90ADA0C07E,1B1B1B1B11,5080808084
2600 DATA 7,3,14,18,0,-1,21,21,1,0,11,3,-1,0
2610 DATA 26D6666063,9C0CACCDC7,9CDCCCC0C7,9C0CCACDC7,9CDCCCC0C7,9C0CCCCDA7,58D8888084
2620 DATA 7,3,20,17,0,-1,15,9,1,0,8,18,-1,0
2630 DATA 2320D06003,1E12008031,9CAC06D3E1,11150A0CC7,11500C0411,E5000A0041,50000800D4
2640 DATA 6,4,8,21,1,0,26,15,0,1,2,15,0,1,14,9,-1,0
2650 DATA BEB1B2DB1B,0A0C0800CD,B1B1B200CD,2C0A0A00A0,11B1BEBB1B,11B1B1BB1B,E50808008D
2660 DATA 7,4,2,15,0,-1,2,18,0,1,29,21,-1,0,23,6,-1,0
2670 DATA 200000600B,900000C003,1D0060C0DE,9000A0A0D0,1D0080C0DE,9000008004,50000000DB
2680 DATA 8,4,26,3,-1,0,12,3,1,0,23,9,-1,0,12,18,1,0
2690 DATA B20DEED03B,B1D0AA0D1B,DA0D1ED0AD,DA00A000AD,DA0D1ED0AD,B1D0AA0D1B,B50DEED04B
2700 DATA 24,3,20,12,1,0,9,12,1,0,23,21,-1,0
2710 DATA 2000000003,1200000D67,11B2000311,11DC000711,1908000411,150000004E,5000000004
2720 DATA 3,4,29,15,0,-1,17,6,-1,0,14,12,-1,0,17,15,1,0

By foody

Champion (325)

foody's picture

30-10-2021, 04:56

THANK YOU SO MUCH!!! I knew there was error in data....I am having hard time with finding the issue in data. I hate copy code with lots of data.

Page 2/3
1 | | 3