-
Notifications
You must be signed in to change notification settings - Fork 0
/
25 - tanc.bas
176 lines (176 loc) · 6.1 KB
/
25 - tanc.bas
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
0 REM TANC
10 REM INITIALIZE
20 POKE53280,2:POKE56,60:POKE52,60:CLR:PRINT"{clear}"
30 FORI=15360TO15360+256:READA:POKEI,A:NEXTI
40 FORI=15616TO15680:POKEI,0:NEXTI
50 POKE15647,24:SH=244:POKE2042,SH:POKE2043,SH:L1=3:P1=L1:L2=L1:H1=L1
60 POKE53269,3:SE=240:POKE53248,27:POKE53249,217:POKE2040,SE:AB=1:AC=1
65 POKE53288,1:SP=243:POKE53250,251:POKE53251,53:POKE2041,SP
66 PRINT"{reverse on}{cm d}{cm i*30}{cm f}"
67 FORI=0TO21:PRINT"{cm k}{space*30}{reverse on}{cm k}":NEXTI
68 PRINT"{reverse on}{cm c}{reverse off}{cm i*30}{reverse on}{cm v}"
69 GOSUB90
70 GOSUB200
71 IFAB=0THENGOSUB830
72 IFAC=0THENGOSUB1030
75 GOSUB400
76 SS=PEEK(53278):SB=PEEK(53279)
77 IF(SSAND6)=6THEN2500
78 IF(SSAND9)=9THEN2000
80 GOTO70
90 PRINT"{home}{right*32}player 1";
91 PRINT"{right*32}lives:";P1
92 PRINT"{right*32}hits:";H1
93 PRINT"{right*32}player 2";
94 PRINT"{right*32}lives:";L1
95 PRINT"{right*32}hits:";L2
96 PRINT"{home}{down*3}{right*3}{reverse on}{light green}{space*11}{right*2}{space*13}{right*11}";
97 PRINT"{right*3}{reverse on}{light green}{space*11}{right*2}{space*13}{right*11}";
98 PRINT"{down*2}{right*3}{reverse on}{light green}{space*4}{right*2}{space*4}{right*2}{space*3}{right*2}{space*3}{right*2}{space*4}{right*11}";
100 PRINT"{right*3}{reverse on}{light green}{space*4}{right*2}{space*4}{right*2}{space*3}{right*2}{space*3}{right*2}{space*4}{right*11}";
101 PRINT"{right*15}{reverse on}{space*3}{right*22}";
102 PRINT"{right*15}{reverse on}{space*3}{right*22}";
103 PRINT"{right*3}{reverse on}{space*4}{right*2}{space*4}{right*2}{space*14}{right*11}";
104 PRINT"{right*3}{reverse on}{space*4}{right*2}{space*4}{right*2}{space*14}{right*11}";
108 PRINT"{down*2}{right*3}{reverse on}{space*5}{right*2}{space*8}{right*2}{space*9}{right*11}";
109 PRINT"{right*3}{reverse on}{space*5}{right*2}{space*8}{right*2}{space*9}{right*11}";
110 PRINT"{down*2}{right*3}{reverse on}{space*5}{right*2}{space*8}{right*2}{space*9}{right*11}";
111 PRINT"{right*3}{reverse on}{light green}{space*5}{right*2}{space*8}{right*2}{space*9}{right*11}{reverse off}";
180 POKE53287,1:POKE53288,0
181 A=PEEK(53278):A=PEEK(53279):SS=0:SB=0
190 RETURN
200 REM JOYSTICK CONTROL
203 IF(SBAND1)=1THENS1=1:GOTO210
205 S1=4
210 IFNOTPEEK(56320)AND1THENSE=240:GOTO242
220 IFNOTPEEK(56320)AND2THENSE=241:GOTO244
230 IFNOTPEEK(56320)AND4THENSE=243:GOTO248
235 IFNOTPEEK(56320)AND8THENSE=242:GOTO246
240 IFNOTPEEK(56320)AND16THENGOTO700
241 RETURN
242 IFPEEK(53249)>49THENPOKE53249,PEEK(53249)-S1:GOTO300
244 IFPEEK(53249)<219THENPOKE53249,PEEK(53249)+S1:GOTO300
245 GOTO242
246 IFPEEK(53248)<253THENPOKE53248,PEEK(53248)+S1:GOTO300
248 IFPEEK(53248)>24THENPOKE53248,PEEK(53248)-S1:GOTO300
249 GOTO246
300 POKE2040,SE
310 IFNOTPEEK(56320)AND16THENGOTO700
350 RETURN
400 REM JOYSTICK CONTROL PL2
402 IF(SBAND2)=2THENS2=1:GOTO410
405 S2=4
410 IFNOTPEEK(56321)AND1THENSP=240:GOTO442
420 IFNOTPEEK(56321)AND2THENSP=241:GOTO444
430 IFNOTPEEK(56321)AND4THENSP=243:GOTO448
435 IFNOTPEEK(56321)AND8THENSP=242:GOTO446
440 IFNOTPEEK(56321)AND16THEN900
441 RETURN
442 IFPEEK(53251)>49THENPOKE53251,PEEK(53251)-S2:GOTO600
444 IFPEEK(53251)<219THENPOKE53251,PEEK(53251)+S2:GOTO600
445 GOTO442
446 IFPEEK(53250)<253THENPOKE53250,PEEK(53250)+S2:GOTO600
448 IFPEEK(53250)>24THENPOKE53250,PEEK(53250)-S2:GOTO600
449 GOTO446
600 POKE2041,SP
610 IFNOTPEEK(56321)AND16THEN900
650 RETURN
700 IFAB=0THEN830
705 AB=0:SC=5:SK=SE
710 POKE53252,PEEK(53248):POKE53253,PEEK(53249)
720 IFSE=240THEN743
730 IFSE=241THEN745
740 IFSE=242THEN747
741 IFPEEK(53252)<20THEN870
742 GOTO750
743 IFPEEK(53253)<20THEN870
744 GOTO760
745 IFPEEK(53253)>235THEN870
746 GOTO770
747 IFPEEK(53252)>235THEN870
748 GOTO780
750 POKE53252,PEEK(53252)-10:GOTO790
760 POKE53253,PEEK(53253)-10:GOTO790
770 POKE53253,PEEK(53253)+10:GOTO790
780 POKE53252,PEEK(53252)+10
790 IFSC=5THENPOKE53269,PEEK(53269)OR4
800 SC=SC-1:IFSC=0THEN870
820 RETURN
830 IFSK=240THEN743
840 IFSK=241THEN745
850 IFSK=242THEN747
860 IFSK=243THEN741
870 POKE53269,PEEK(53269)AND251:AB=1
890 RETURN
900 IFAC=0THEN1030
905 AC=0:SD=5:SL=SP
910 POKE53254,PEEK(53250):POKE53255,PEEK(53251)
920 IFSP=240THEN943
930 IFSP=241THEN945
940 IFSP=242THEN947
941 IFPEEK(53254)<20THEN1070
942 GOTO950
943 IFPEEK(53255)<20THEN1070
944 GOTO960
945 IFPEEK(53255)>235THEN1070
946 GOTO970
947 IFPEEK(53254)>235THEN1070
948 GOTO980
950 POKE53254,PEEK(53254)-10:GOTO990
960 POKE53255,PEEK(53255)-10:GOTO990
970 POKE53255,PEEK(53255)+10:GOTO990
980 POKE53254,PEEK(53254)+10
990 IFSD=5THENPOKE53269,PEEK(53269)OR8
1000 SD=SD-1:IFSD=0THEN1070
1020 RETURN
1030 IFSL=240THEN943
1040 IFSL=241THEN945
1050 IFSL=242THEN947
1060 IFSL=243THEN941
1070 POKE53269,PEEK(53269)AND247:AC=1
1080 RETURN
2000 REMPLAYERTWO
2005 GOSUB1070
2010 L2=L2-1
2020 PRINT"{home}{down*6}{right*38}";L1
2030 PRINT"{right*37}";L2
2040 IFL2=0THENL2=4:L1=L1-1
2050 IFL1=0THEN3000
2055 SS=PEEK(53278):SB=PEEK(53279)
2060 GOTO70
2500 REMPLAYERONE
2505 GOSUB870
2510 H1=H1-1
2520 PRINT"{home}{down}{right*38}";P1
2530 PRINT"{right*37}";H1
2540 IFH1=0THENH1=4:P1=P1-1
2550 IFP1=0THEN3100
2555 SS=PEEK(53278):SB=PEEK(53279)
2560 GOTO70
3000 PRINT"{clear}{reverse on}{right*6}player one ";
3010 GOTO3150
3100 PRINT"{clear}{reverse on}{right*6}player two ";
3150 POKE53269,0
3200 PRINT"{reverse on}won."
3250 PRINT
3300 PRINT"another game.(y/n)"
3310 IFPEEK(197)=25THENRUN
3315 IFPEEK(197)<>39THEN3310
3320 PRINT"{clear}":STOP
5000 REM UP TANC
5010 DATA0,0,0,0,0,0,0,60,0,0,24,0,7,24,224,7,24,224,7,24,224,7,24,224
5020 DATA7,255,224,7,255,224,7,255,224,7,255,224,7,255,224,7,255,224
5030 DATA7,0,224,7,0,224,7,0,224,7,0,224,0,0,0,0,0,0,0,0,0,0
5050 REM DOWN TANC
5060 DATA 0,0,0,0,0,0,0,0,0,7,0,224,7,0,224,7,0,224,7,0,224,7,255,224,7,255,224
5070 DATA7,255,224,7,255,224,7,255,224,7,255,224,7,24,224,7,24,224,7,24,224
5080 DATA7,24,224,0,24,0,0,60,0,0,0,0,0,0,0,0
5100 REM RIGHT TANC
5110 DATA0,0,0,0,0,0,0,0,0,0,0,0,3,255,224,3,255,224,3,255,224,0,62,0,0,62,0
5120 DATA0,62,8,0,63,248,0,63,248,0,62,8,0,62,0,0,62,0,3,255,224,3,255,224
5130 DATA3,255,224,0,0,0,0,0,0,0,0,0,0
5150 REMLEFT TANC
5160 DATA0,0,0,0,0,0,0,0,0,0,0,0,3,255,224,3,255,224,3,255,224,0,62,0,0,62,0
5170 DATA8,62,0,15,254,0,15,254,0,8,62,0,0,62,0,0,62,0,3,255,224,3,255,224
5180 DATA3,255,224,0,0,0,0,0,0,0,0,0,0,0
9000 PRINTPEEK(197):GOTO9000