-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathHOCKEY.BAS
159 lines (159 loc) · 5.45 KB
/
HOCKEY.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
1 REM OLYMPIC HOCKEY by Thomas Brown
5 GOTO 200
10 IF VP(0)<81 THEN VP(0)=81
12 IF VP(1)<81 THEN VP(1)=81
14 IF VP2<82 THEN VP2=82
16 IF VP(0)>105 THEN VP(0)=105
18 IF VP(1)>105 THEN VP(1)=105
20 IF VP2>106 THEN VP2=106
22 IF HP(0)<79 THEN HP(0)=79
24 IF HP(1)<79 THEN HP(1)=79
26 IF HP2<74 THEN HP2=74
28 IF HP(0)>167 THEN HP(0)=167
30 IF HP(1)>167 THEN HP(1)=167
32 IF HP2>172 THEN HP2=172
34 RETURN
40 FOR I=1 TO 9:READ S:S$(I)=CHR$(S):NEXT I
45 RETURN
50 FOR I=1 TO 9:READ S:SS$(I)=CHR$(S):NEXT I
55 RETURN
60 FOR I=1 TO 9:READ S:SSS$(I)=CHR$(S):NEXT I
65 RETURN
70 BEGIN=PEEK(560)+PEEK(561)*256+4
72 POKE BEGIN-1,70
74 POKE BEGIN+2,6
76 POKE BEGIN+91,65:POKE BEGIN+92,PEEK(560):POKE BEGIN+93,PEEK(561)
78 POKE 87,1:POSITION 0,0:? #6;"HOME TIME VISITORS "
80 MIN=3:TEN=5:SEC=9
82 POSITION 0,1:? #6;" 0 4:00 0 "
83 POSITION 1,1:? #6;G1:POSITION 15,1:? #6;G2
84 RETURN
86 POKE 87,1
88 POSITION 6,1
90 ? #6;MIN;":";TEN;SEC
92 SEC=SEC-1
94 IF SEC>=0 THEN RETURN
98 SEC=9:TEN=TEN-1
100 IF TEN>=0 THEN RETURN
104 TEN=5:MIN=MIN-1
106 IF MIN>=0 THEN RETURN
107 GOTO 180
110 VP2=VP(C)+1:ST=STICK(C):IF ST=15 THEN RETURN
112 IF DIR(C)=0 THEN HP2=HP(C)+6
114 IF DIR(C)=1 THEN HP2=HP(C)-6
116 POKE 53760,25+C*10:POKE 53761,162
118 T=STRIG(C):IF T=0 THEN 120
119 POKE 53760,0:RETURN
120 POKE 53760,5:POKE 53761,74
121 TX=(ST=6 OR ST=7 OR ST=5)-(ST=10 OR ST=11 OR ST=9)
122 TY=(ST=9 OR ST=13 OR ST=5)-(ST=10 OR ST=14 OR ST=6)
124 Q=Q+1
126 HP2=HP2+TX:VP2=VP2+TY
128 IF HP2>172 OR HP2<74 THEN TX=-TX
130 IF VP2>106 OR VP2<82 THEN TY=-TY
132 POKE 53250,HP2
134 P2$(VP2,VP2+LS2)=SSS$
135 IF HP2>172 AND VP2>=93 AND VP2<=97 THEN G2=G2+1:GOSUB 83:Q=0:GOSUB 7000:GOTO 316
136 IF HP2<74 AND VP2>=93 AND VP2<=97 THEN G1=G1+1:GOSUB 83:Q=0:GOSUB 7000:GOTO 316
137 IF Q>3 THEN POKE 53760,0:POKE 53761,0
138 IF Q<12 THEN 124
139 Q=0:RETURN
180 FOR D=1 TO 4:SOUND D-1,D*20,10,8:NEXT D:FOR D=1 TO 250:NEXT D
185 FOR D=0 TO 3:SOUND D,0,0,0:NEXT D
190 FOR D=1 TO 1500:NEXT D
200 GRAPHICS 18:CLR
202 FOR CLEAR=53248 TO 53250
204 POKE CLEAR,0
206 NEXT CLEAR
210 SETCOLOR 4,9,3
212 POSITION 3,4
214 ? #6;"olympic hockey"
216 POSITION 5,5
218 ? #6;"one on one"
220 POSITION 1,9
222 ? #6;"hit start to begin"
224 IF PEEK(53279)=6 THEN 300
226 GOTO 224
300 GOSUB 1000
302 DIM X$(1)
304 A=ADR(X$)
306 B=INT((A-512)/2048+1)*2048
308 DIM F$(B-A+511)
310 DIM P0$(128):DIM P1$(128):DIM P2$(128)
312 DIM DIR(1),HP(170),VP(110)
314 DIM S$(9),SS$(9),SSS$(9)
316 RESTORE 6000:GOSUB 40
318 RESTORE 6010:GOSUB 50
320 RESTORE 6020:GOSUB 60
324 P0$=CHR$(0):P1$=CHR$(0):P2$=CHR$(0)
326 P0$(128)=CHR$(0):P1$(128)=CHR$(0):P2$(128)=CHR$(0)
327 P0$(2)=P0$:P1$(2)=P1$:P2$(2)=P2$
328 POKE 623,1
330 POKE 54279,INT(B/256)
332 POKE 559,46
334 POKE 53277,3
336 POKE 704,128
338 POKE 705,85
340 POKE 706,0
342 HP(0)=115:HP(1)=135:HP2=124:VP(0)=95:VP(1)=95:VP2=95
345 DIR(0)=0:DIR(1)=1:C=2
350 POKE 53256,0
352 LS=LEN(S$)
354 LS1=LEN(SS$)
356 LS2=LEN(SSS$)
420 POKE 752,1
430 POKE 53278,0
500 P0$(VP(0),VP(0)+LS)=S$
501 P1$(VP(1),VP(1)+LS1)=SS$
502 P2$(VP2,VP2+LS2)=SSS$
503 POKE 53248,HP(0)
504 POKE 53249,HP(1)
505 POKE 53250,HP2
506 JACK=JACK+0.5:IF JACK=INT(JACK) THEN GOSUB 86
530 S=STICK(0)
535 S1=STICK(1)
536 HM=(S=6 OR S=7 OR S=5)-(S=10 OR S=11 OR S=9)
537 VM=(S=9 OR S=13 OR S=5)-(S=10 OR S=14 OR S=6)
538 HM1=(S1=6 OR S1=7 OR S1=5)-(S1=10 OR S1=11 OR S1=9)
539 VM1=(S1=9 OR S1=13 OR S1=5)-(S1=10 OR S1=14 OR S1=6)
540 IF C=1 AND HM=1 THEN HM=2
541 IF C=1 AND HM=-1 THEN HM=-2
542 IF C=0 AND HM1=1 THEN HM1=2
543 IF C=0 AND HM1=-1 THEN HM1=-2
544 HP(0)=HP(0)+HM*2:VP(0)=VP(0)+VM
545 HP(1)=HP(1)+HM1*2:VP(1)=VP(1)+VM1
547 IF S1>4 AND S1<8 AND DIR(1)=1 THEN RESTORE 6000:GOSUB 50:DIR(1)=0
548 IF S>4 AND S<8 AND DIR(0)=1 THEN RESTORE 6000:GOSUB 40:DIR(0)=0
549 IF S>8 AND S<12 AND DIR(0)=0 THEN RESTORE 6010:GOSUB 40:DIR(0)=1
550 IF S1>8 AND S1<12 AND DIR(1)=0 THEN RESTORE 6010:GOSUB 50:DIR(1)=1
551 IF HP2>HP(1)-11 AND HP2<HP(1)+8 AND VP2>VP(1)-4 AND VP2<VP(1)+3 AND DIR(1)=0 THEN C=1:GOSUB 110
552 IF HP2>HP(1)-8 AND HP2<HP(1)+11 AND VP2>VP(1)-4 AND VP2<VP(1)+3 AND DIR(1)=1 THEN C=1:GOSUB 110
553 IF HP2>HP(0)-11 AND HP2<HP(0)+8 AND VP2>VP(0)-4 AND VP2<VP(0)+3 AND DIR(0)=0 THEN C=0:GOSUB 110
554 IF HP2>HP(0)-8 AND HP2<HP(0)+11 AND VP2>VP(0)-4 AND VP2<VP(0)+3 AND DIR(0)=1 THEN C=0:GOSUB 110
555 GOSUB 10
570 POKE 53278,0
590 GOTO 500
1000 GRAPHICS 7+16:GOSUB 70:POKE 87,7:SETCOLOR 4,7,6
1010 SETCOLOR 0,0,14:COLOR 1:PLOT 159,88:DRAWTO 132,63
1020 DRAWTO 26,63:POSITION 0,88:POKE 765,1:XIO 18,#6,0,0,"S:"
1030 SETCOLOR 1,0,8:COLOR 2:PLOT 0,88:DRAWTO 26,63
1040 DRAWTO 26,58:DRAWTO 0,77:PLOT 159,88:DRAWTO 132,63
1050 DRAWTO 132,58:DRAWTO 159,77:PLOT 26,58:DRAWTO 132,58
1060 PLOT 132,63:DRAWTO 26,63:PLOT 24,57:DRAWTO 0,32
1070 PLOT 159,32:DRAWTO 133,57:SETCOLOR 2,5,8:COLOR 3
1080 PLOT 100,64:DRAWTO 105,88:PLOT 60,64:DRAWTO 55,88
1090 PLOT 80,64:DRAWTO 80,70:PLOT 80,84:DRAWTO 80,88
1100 PLOT 80,70:DRAWTO 88,77:DRAWTO 80,84:DRAWTO 72,77
1110 DRAWTO 80,70:PLOT 26,81:DRAWTO 30,77:DRAWTO 30,70
1120 DRAWTO 26,74:DRAWTO 26,81:DRAWTO 20,81:DRAWTO 20,78
1130 DRAWTO 28,69:PLOT 29,69:PLOT 25,74:PLOT 22,88
1140 DRAWTO 25,82:PLOT 31,74:DRAWTO 35,64:PLOT 132,81
1150 DRAWTO 128,77:DRAWTO 128,70:DRAWTO 132,74:DRAWTO 132,81
1160 DRAWTO 138,81:DRAWTO 138,78:DRAWTO 130,69:PLOT 129,69
1170 PLOT 133,74:PLOT 136,88:DRAWTO 133,82:PLOT 127,74
1180 DRAWTO 123,64:RETURN
6000 DATA 0,24,16,48,124,82,138,139,0
6010 DATA 0,24,8,12,62,74,81,209,0
6020 DATA 0,0,0,0,0,24,24,0,0
7000 FOR S0=100 TO 0 STEP -5:FOR S1=20 TO 10 STEP -2:SOUND 0,S0,10,8:SOUND 1,S1,10,8:NEXT S1:NEXT S0
7010 SOUND 0,0,0,0:SOUND 1,0,0,0:RETURN