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
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
|
-
|
|
|
|
|
|
|
|
|
|
|
-
|
!
|
!
-
|
-
|
!
-
|
|
|
|
|
|
!
-
|
|
!
-
|
|
|
|
|
|
|
!
-
|
|
|
|
!
|
#module
#deffunc frp_int int max
dim parlist, 11, max
parlist_max = -1 parlist_maxlimt = max
return
#deffunc SetCrctMng var id, int px, int py, int pz, int vx, int vy, int vz, int ax, int ay, int az, int _lifet
id = -1
if (parlist_max+1)>=parlist_maxlimt : i = parlist_max + 1 : else : i = parlist_max + 2
repeat i
if parlist(0, cnt) = 0 : id = cnt : break
loop
if id < 0 : return -1
parlist(0, id) = 1 parlist(1, id) = px parlist(2, id) = py
parlist(3, id) = pz
parlist(4, id) = vx parlist(5, id) = vy
parlist(6, id) = vz
parlist(7, id) = ax parlist(8, id) = ay
parlist(9, id) = az
lifet = _lifet if _lifet < 0 : lifet = 0 : else : if _lifet = 0 : lifet = -1
parlist(10, id) = lifet if parlist_max<id : parlist_max = id
return
#deffunc SetCMPos int id, int px, int py, int pz
parlist(1, id) = px, py, pz
return
#deffunc SetCMVel int id, int vx, int vy, int vz
parlist(4, id) = vx, vy, vz
return
#deffunc SetCMAcc int id, int ax, int ay, int az
parlist(7, id) = ax, ay, az
return
#deffunc AddCMPos int id, int px, int py, int pz
parlist(1, id) += px
parlist(2, id) += py
parlist(3, id) += pz
return
#deffunc AddCMVel int id, int vx, int vy, int vz
parlist(4, id) += vx
parlist(5, id) += vy
parlist(6, id) += vz
return
#deffunc AddCMAcc int id, int ax, int ay, int az
parlist(7, id) += ax
parlist(8, id) += ay
parlist(9, id) += az
return
#deffunc DelCrctMng int id
parlist(0, id) = 0 if parlist_max<id : parlist_max = id-1
return
#deffunc UpCMTime
repeat parlist_max + 1
if parlist(0, cnt) = 1 {
parlist(4, cnt) += parlist(7, cnt)
parlist(5, cnt) += parlist(8, cnt)
parlist(6, cnt) += parlist(9, cnt)
parlist(1, cnt) += parlist(4, cnt)
parlist(2, cnt) += parlist(5, cnt)
parlist(3, cnt) += parlist(6, cnt)
parlist(7, cnt) = 0
parlist(8, cnt) = 0
parlist(9, cnt) = 0
if parlist(10,cnt)>0 {
parlist(10,cnt) --
}
if parlist(10,cnt) = 0 : parlist(0, cnt) = 0
}
loop
return
#defcfunc fnGetCMActive int id
if id<parlist_maxlimt {
return parlist(0, id)
} else {
return -1
}
#deffunc GetCMPos int id, var px, var py, var pz
px = parlist(1, id)
py = parlist(2, id)
pz = parlist(3, id)
return
#deffunc GetCMVel int id, var vx, var vy, var vz
vx = parlist(4, id)
vy = parlist(5, id)
vz = parlist(6, id)
return
#define global GetUnActiveCM _GetUnActiveCM()
#defcfunc _GetUnActiveCM
uaid = -1
if (parlist_max+1)>=parlist_maxlimt : i = parlist_max + 1 : else : i = parlist_max + 2
repeat i
if parlist(0, cnt) = 0 : uaid = cnt : break
loop
return uaid
#global
frp_int 1500
wldx = ginfo_winx wldy = ginfo_winy-20
grav = 1 maxchr = 50 id_tama = 0
randomize
*main
redraw 1 : await 33 : redraw 0 : color 255,255,255 : boxf : color
stick key, 16
if key&128 : end if key&16 { SetCrctMng id_tama, ginfo_winx/2, ginfo_winy/2,, rnd(20)-10,-rnd(10)-10,, ,,, 40
}
cx = ginfo_winx/2
cy = ginfo_winy/2
circle cx-20+8, cy-20+8, cx+20+8, cy+20+8, 0
repeat maxchr
i = ginfo_winx*3/5
line i,0, i,ginfo_winy
mes "消滅ゾーン\n→"
if fnGetCMActive(cnt) = 1 { GetCMPos cnt, px, py, pz
if px > i : DelCrctMng cnt
}
loop
repeat maxchr
if fnGetCMActive(cnt) = 1 { AddCMAcc cnt, 0, grav GetCMPos cnt, px, py, pz
GetCMVel cnt, vx, vy, vz
if px < 0 : SetCMPos cnt, 0, py : SetCMVel cnt, -vx, vy
if px > wldx : SetCMPos cnt, wldx, py : SetCMVel cnt, -vx, vy
if py > wldy : SetCMPos cnt, px, wldy : SetCMVel cnt, vx, -vy
}
loop
UpCMTime
repeat maxchr
if fnGetCMActive(cnt) = 1 { GetCMPos cnt, px, py, pz
pos px, py
mes "■"
}
loop
goto *main
|