-
Notifications
You must be signed in to change notification settings - Fork 0
/
KarateComputer.txt
131 lines (130 loc) · 6 KB
/
KarateComputer.txt
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
1 REM KARATE FOR ONE PLAYER
2 CALL CHARPAT(ASC("!"),A$):: IF A$<>"0000000000003030" THEN DISPLAY AT(12,1)ERA
SE ALL:"IMPROPER LOADING-PLEASE WAIT" :: RUN "DSK1.KLOAD"
7 DISPLAY AT(24,1):"PROGRAM LOADEDZ PLEASE WAIT!" :: CALL SOUND(300,110,0,220,0,
330,0)
8 FOR DE=1 TO 200 :: NEXT DE
9 CALL MAGNIFY(4)
10 REGULARG=96 :: REGULARB=100 :: LOWKICKG=104 :: LOWKICKB=108 :: MEDKICKG=112 :
: MEDKICKB=116 :: HIGHPUNCHG=120 :: HIGHPUNCHB=124
11 MEDPUNCHG=60 :: MEDPUNCHB=92 :: HIT=40 :: MOUND=44 :: STAR=36 :: FIGHT=1 :: W
ING,WINB,BF,SCG,SCB=0 :: STRENGTHG,STRENGTHB=7 :: CALL CLEAR :: GOSUB 95
12 CALL COLOR(12,2,2):: FOR I=10 TO 22 :: CALL HCHAR(I,3,124,28):: NEXT I :: CAL
L COLOR(11,11,11):: CALL HCHAR(9,3,116,28):: CALL HCHAR(23,3,116,28)
13 CALL COLOR(10,3,3)
14 DISPLAY AT(1,10):"# KARATE #" :: DISPLAY AT(3,3):"PLAYER 1:" :: DISPLAY AT(3,
17):"COMPUTER:"
15 DISPLAY AT(5,3):RPT$("h",STRENGTHG):: DISPLAY AT(5,17):RPT$("h",STRENGTHB)::
DISPLAY AT(6,2):SCG :: DISPLAY AT(6,16):SCB
16 DISPLAY AT(7,2)SIZE(2):WING :: DISPLAY AT(7,16)SIZE(2):WINB :: DISPLAY AT(8,1
0):"FIGHT:";FIGHT
17 CALL SPRITE(#2,REGULARG,5,110,50,#3,REGULARB,7,110,168,#1,HIT,11,193,1):: GLO
C=50 :: BLOC=168
18 DISPLAY AT(24,1)BEEP:"PRESS FIRE BUTTON 1 TO START"
19 CALL KEY(1,K,S):: IF K=18 THEN 20 ELSE 19
20 DISPLAY AT(24,1):"" :: CALL SOUND(100,400,0):: CALL SOUND(100,200,0):: CALL S
OUND(100,600,0):: CALL SOUND(100,300,0):: CALL SOUND(100,150,0)
21 REM GAME!
22 CALL JOYST(1,XG,YG):: CALL KEY(1,KG,SG)
23 IF KG<>18 THEN GLOC=GLOC+(XG*1.5)
24 IF GLOC<30 THEN GLOC=30
25 CALL DISTANCE(#2,#3,AB):: IF AB>484 THEN BLOC=BLOC-6
26 IF BLOC>204 THEN BLOC=204
27 IF GLOC>BLOC-12 THEN GLOC=GLOC-6 :: BLOC=BLOC+6
28 CALL LOCATE(#2,110,GLOC,#3,110,BLOC)
29 IF INT(RND*HARD)=1 THEN CALL DISTANCE(#2,#3,AB)
30 IF BF=0 THEN 34
31 IF KG=18 THEN GOSUB 37
32 IF AB<=484 THEN GOSUB 50
33 GOTO 22
34 IF AB<=484 THEN GOSUB 50
35 IF KG=18 THEN GOSUB 37
36 GOTO 22
37 REM GOOD GUY HIT BAD
38 IF XG<>0 AND YG<>0 THEN 39 ELSE RETURN
39 IF XG=-4 AND YG=4 THEN CHAR=HIGHPUNCHG :: VERT=100
40 IF XG=4 AND YG=4 THEN CHAR=MEDKICKG :: VERT=110
41 IF XG=-4 AND YG=-4 THEN CHAR=MEDPUNCHG :: VERT=110
42 IF XG=4 AND YG=-4 THEN CHAR=LOWKICKG :: VERT=120
43 CALL PATTERN(#2,CHAR):: CALL COINC(ALL,A):: IF A THEN 45
44 FOR I=0 TO 28 STEP 4 :: CALL SOUND(-50,-2,I):: NEXT I :: FOR DE=1 TO 10 :: NE
XT DE :: BF=0 :: CALL PATTERN(#2,REGULARG):: RETURN
45 CALL LOCATE(#1,VERT,BLOC-4):: CALL SOUND(10,110,0,-5,0):: STRENGTHB=STRENGTHB
-1 :: SCG=SCG+10
46 FOR DE=1 TO 25 :: NEXT DE :: CALL LOCATE(#1,193,1):: CALL PATTERN(#2,REGULARG
)
47 DISPLAY AT(5,17)SIZE(7):RPT$("h",STRENGTHB):: DISPLAY AT(6,2):SCG;:: IF STREN
GTHB=0 THEN 63
48 BLOC=BLOC+12 :: CALL LOCATE(#3,110,BLOC)
49 RETURN
50 A=INT(RND*5)+1 :: IF A=1 THEN BLOC=BLOC+6 :: CALL LOCATE(#3,110,BLOC):: RETUR
N
51 HITTYPE=INT(RND*4)+1
52 IF HITTYPE=1 THEN CHAR=HIGHPUNCHB :: VERT=100
53 IF HITTYPE=2 THEN CHAR=MEDKICKB :: VERT=110
54 IF HITTYPE=3 THEN CHAR=MEDPUNCHB :: VERT=110
55 IF HITTYPE=4 THEN CHAR=LOWKICKB :: VERT=120
56 CALL PATTERN(#3,CHAR):: CALL COINC(ALL,A):: IF A THEN 58
57 FOR I=0 TO 28 STEP 4 :: CALL SOUND(-50,-2,I):: NEXT I :: FOR DE=1 TO 10 :: NE
XT DE :: BF=1 :: CALL PATTERN(#3,REGULARB):: RETURN
58 CALL LOCATE(#1,VERT,GLOC+4):: CALL SOUND(10,110,0,-5,0):: STRENGTHG=STRENGTHG
-1 :: SCB=SCB+10
59 FOR DE=1 TO 25 :: NEXT DE :: CALL LOCATE(#1,193,1):: CALL PATTERN(#3,REGULARB
)
60 DISPLAY AT(5,3)SIZE(7):RPT$("h",STRENGTHG):: DISPLAY AT(6,16):SCB;:: IF STREN
GTHG=0 THEN 70
61 GLOC=GLOC-12 :: CALL LOCATE(#2,110,GLOC)
62 RETURN
63 FOR I=1 TO 8 :: CALL SOUND(-999,110,0):: CALL PATTERN(#3,REGULARG):: CALL SOU
ND(-999,220,0):: CALL PATTERN(#3,REGULARB):: NEXT I
64 CALL SOUND(-1,44000,30):: CALL PATTERN(#3,MOUND):: FOR DE=1 TO 250 :: NEXT DE
:: CALL DELSPRITE(#3)
65 FOR I=STRENGTHG TO 1 STEP -1 :: SCG=SCG+10 :: DISPLAY AT(5,3)SIZE(7):RPT$("h"
,I-1);:: DISPLAY AT(6,2):SCG;:: CALL SOUND(10,I*110+110,0):: NEXT I
66 WING=WING+1 :: DISPLAY AT(7,2)SIZE(2):WING;:: FIGHT=FIGHT+1 :: IF FIGHT=8 THE
N 77
67 STRENGTHG=7 :: STRENGTHB=7
68 DISPLAY AT(5,3)SIZE(7):RPT$("h",STRENGTHG):: DISPLAY AT(5,17)SIZE(7):RPT$("h"
,STRENGTHB):: DISPLAY AT(6,2):SCG;:: DISPLAY AT(6,16):SCB
69 GOTO 16
70 FOR I=1 TO 8 :: CALL SOUND(-999,110,0):: CALL PATTERN(#2,REGULARG):: CALL SOU
ND(-999,220,0):: CALL PATTERN(#2,REGULARB):: NEXT I
71 CALL SOUND(-1,44000,30):: CALL PATTERN(#2,MOUND):: FOR DE=1 TO 250 :: NEXT DE
:: CALL DELSPRITE(#2)
72 FOR I=STRENGTHB TO 1 STEP -1 :: SCB=SCB+10 :: DISPLAY AT(5,17)SIZE(7):RPT$("h
",I-1):: DISPLAY AT(6,16):SCB :: CALL SOUND(10,I*110+110,0):: NEXT I
73 WINB=WINB+1 :: DISPLAY AT(7,16)SIZE(2):WING :: FIGHT=FIGHT+1 :: IF FIGHT=8 TH
EN 77
74 STRENGTHG=7 :: STRENGTHB=7
75 DISPLAY AT(5,3)SIZE(7):RPT$("h",STRENGTHG):: DISPLAY AT(5,17)SIZE(7):RPT$("h"
,STRENGTHB):: DISPLAY AT(6,2):SCG;:: DISPLAY AT(6,16):SCB
76 GOTO 16
77 REM game over
78 CALL DELSPRITE(ALL):: FOR I=9 TO 24 :: DISPLAY AT(I,1):"" :: NEXT I :: IF SCG
>SCB THEN WINP$="HUMAN WON BY POINTS"
79 IF SCB>SCG THEN WINP$="COMPUTER WON BY POINTS"
80 IF SCG=SCB THEN WINP$="NO WINNER BY POINTS"
81 IF WING>WINB THEN WINM$="HUMAN WON BY MATCHES"
82 IF WINB>WING THEN WINM$="COMPUTER WON BY MATCHES"
83 IF WINB>WING AND SCB>SCG THEN TOTAL$="COMPUTER IS THE CLEAR WINNER" :: GOTO 8
6
84 IF WING>WINB AND SCG>SCB THEN TOTAL$="HUMAN IS THE CLEAR WINNER" :: GOTO 86
85 TOTAL$="NO CLEAR WINNER"
86 DISPLAY AT(10,10):"SUMMARY:" :: DISPLAY AT(13,(28-LEN(WINP$))/2):WINP$
87 DISPLAY AT(14,(28-LEN(WINM$))/2):WINM$
88 DISPLAY AT(17,(28-LEN(TOTAL$))/2):TOTAL$
89 DISPLAY AT(21,9):"GAME OVER" :: DISPLAY AT(22,5)BEEP:"PLAY AGAINQQ Y OR N"
90 CALL KEY(3,K,S):: IF S=0 THEN 90
91 IF K=78 THEN CALL CLEAR :: STOP
92 IF K=89 THEN CALL CLEAR :: GOTO 10
93 CALL SOUND(100,110,0,220,0,330,0)
94 GOTO 90
95 DISPLAY AT(1,9):"# KARATE #" :: DISPLAY AT(4,1):"DIFFICULTY:" :: DISPLAY AT(6
,4):"1! BEGINNER" :: DISPLAY AT(8,4):"2! INTERMEDIATE"
96 DISPLAY AT(10,4):"3! ADVANCED"
97 CALL KEY(0,K,S):: IF S=0 THEN 97
98 IF K=49 THEN HARD=0 :: GOTO 102
99 IF K=50 THEN HARD=4 :: GOTO 102
100 IF K=51 THEN HARD=2 :: GOTO 102
101 CALL SOUND(100,110,0):: GOTO 97
102 CALL CLEAR :: RETURN