7
|
1 #include "dandy.h"
|
|
2
|
|
3 static const int FRAME_RATE = 32;
|
|
4
|
|
5 void Putenemy(int charano, int x, int y, int sx, int sy, int move, int coll,
|
|
6 SceneGraphPtr node, void *sgroot_);
|
|
7
|
|
8 void
|
|
9 schedule(SceneGraphPtr node, void *sgroot_, int w, int h)
|
|
10 {
|
8
|
11 SceneGraphRoot *sgroot = (SceneGraphRoot *)sgroot_;
|
|
12 Pad *pad = sgroot->getController();
|
9
|
13 // Title 画面
|
10
|
14 /*
|
8
|
15 if(back_property.flag == 0){
|
9
|
16 Putenemy(0, w/2, h/2, 0, 0, MOVE_00, MOVE_00, node, sgroot);
|
8
|
17 if(pad->start.isPush()) {
|
|
18 back_property.flag = 1;
|
|
19 //node->children->remove();
|
|
20 }
|
|
21 }
|
10
|
22 */
|
8
|
23
|
|
24 if(back_property.flag == 1) {
|
7
|
25 switch (node->frame) {
|
|
26 case 1:
|
|
27 break;
|
8
|
28 case FRAME_RATE * 10:
|
|
29 Putenemy(1, w/2, 0, 2, 4, MOVE_00, MOVE_00, node, sgroot);
|
7
|
30 break;
|
8
|
31 case FRAME_RATE * 20:
|
|
32 Putenemy(1, w/3, 0, 0, 8, MOVE_00, MOVE_00, node, sgroot);
|
|
33 Putenemy(1, w/2, 0, 0, 8, MOVE_00, MOVE_00, node, sgroot);
|
7
|
34 break;
|
|
35 /*
|
|
36 case FRAME_RATE * 4:
|
|
37 Putenemy(1, 120, -128, 0, 4, chara_state0);
|
|
38 break;
|
|
39 case FRAME_RATE * 5:
|
|
40 Putenemy(1, 224, -128, 1, 1, chara_state0);
|
|
41 Putenemy(1, 184, -128, 1, 1, chara_state0);
|
|
42 break;
|
|
43 case FRAME_RATE * 6:
|
|
44 Putenemy(1, 120, -128, 1, 2, chara_state0);
|
|
45 break;
|
|
46 case FRAME_RATE * 7:
|
|
47 Putenemy(1, 56, -128, 0, 1, chara_state0);
|
|
48 Putenemy(1, 184, -128, 0, 1, chara_state0);
|
|
49 break;
|
|
50 case FRAME_RATE * 8:
|
|
51 Putenemy(2, 120, -128, 0, 1, chara_state0);
|
|
52 break;
|
|
53
|
|
54 case FRAME_RATE * 12:
|
|
55 Putenemy(1, 1280 - 128 - 120, -128, 0, 1, chara_state4);
|
|
56 break;
|
|
57 case FRAME_RATE * 13:
|
|
58 Putenemy(1, 1280 - 128 - 120, -128, 0, 1, chara_state4);
|
|
59 break;
|
|
60 case FRAME_RATE * 14:
|
|
61 Putenemy(1, 1280 - 128 - 120, -128, 0, 1, chara_state4);
|
|
62 break;
|
|
63 case FRAME_RATE * 15:
|
|
64 Putenemy(2, 1280 - 128 - 120, -128, -1, 1, chara_state4);
|
|
65 break;
|
|
66 case FRAME_RATE * 16:
|
|
67 Putenemy(2, 1280 - 128 - 120, -128, 0, 1, chara_state4);
|
|
68 break;
|
|
69 case FRAME_RATE * 17:
|
|
70 Putenemy(2, 1280 - 128 - 120, -128, 0, 1, chara_state4);
|
|
71 break;
|
|
72 case FRAME_RATE * 18:
|
|
73 Putenemy(1, 1280 - 128 - 120, -32, 0, 1, chara_state4);
|
|
74 Putenemy(1, 1280 - 128, -128, -2, 1, chara_state4);
|
|
75 Putenemy(1, 800, -88, -1, 1, chara_state4);
|
|
76 break;
|
|
77
|
|
78 case FRAME_RATE * 24:
|
|
79 Putenemy(1, 256, -128, 0, 1, chara_state4);
|
|
80 Putenemy(1, 1280 - 256 - 128, -128, 0, 1, chara_state4);
|
|
81 break;
|
|
82 case FRAME_RATE * 25:
|
|
83 Putenemy(2, 512, -128, 0, 1, chara_state4);
|
|
84 Putenemy(2, 1280 - 128, -128, 0, 1, chara_state4);
|
|
85 break;
|
|
86 case FRAME_RATE * 26:
|
|
87 Putenemy(1, 384, -128, 0, 1, chara_state4);
|
|
88 Putenemy(1, 1280 - 256, -128, 0, 2, chara_state4);
|
|
89 Putenemy(1, 512, -128, 0, 3, chara_state4);
|
|
90 Putenemy(1, 1280 - 256, -128, 0, 2, chara_state4);
|
|
91 break;
|
|
92 case FRAME_RATE * 27:
|
|
93 Putenemy(2, 512, -128, 0, 3, chara_state2);
|
|
94 Putenemy(2, 256 - 128, -128, 0, 2, chara_state2);
|
|
95 Putenemy(2, 768, -128, 0, 4, chara_state2);
|
|
96 Putenemy(2, 128, -128, 0, 3, chara_state2);
|
|
97 break;
|
|
98 case FRAME_RATE * 28:
|
|
99 Putenemy(1, 256, -128, 0, 1, chara_state4);
|
|
100 Putenemy(1, 1280 - 256 - 128, -128, 0, 1, chara_state4);
|
|
101 break;
|
|
102 case FRAME_RATE * 29:
|
|
103 Putenemy(2, 256, -128, 0, 1, chara_state4);
|
|
104 Putenemy(2, 1280 - 256 - 128, -128, 0, 1, chara_state4);
|
|
105 break;
|
|
106 case FRAME_RATE * 30:
|
|
107 Putenemy(1, 256, -128, 0, 1, chara_state4);
|
|
108 Putenemy(1, 1280 - 256 - 128, -128, 0, 1, chara_state4);
|
|
109 break;
|
|
110
|
|
111 case FRAME_RATE * 33:
|
|
112 Putenemy(1, 256, 1088, 0, -1, chara_state5);
|
|
113 Putenemy(1, 1280 - 256 - 128, 1088, 0, -1, chara_state5);//5/22/pm5:300
|
|
114 break;
|
|
115 case FRAME_RATE * 34:
|
|
116 Putenemy(2, 256, 1088, 0, -1, chara_state5);
|
|
117 Putenemy(2, 1280 - 256 - 128, 1088, 0, -1, chara_state5);
|
|
118 break;
|
|
119 case FRAME_RATE * 35:
|
|
120 Putenemy(1, 256, 1088, 0, -1, chara_state5);
|
|
121 Putenemy(1, 1280 - 256 - 128, 1088, 0, -1, chara_state5);
|
|
122 break;
|
|
123 case FRAME_RATE * 36:
|
|
124 Putenemy(2, 256, 1088, 0, -1, chara_state5);
|
|
125 Putenemy(2, 1280 - 256 - 128, 1088, 0, -1, chara_state5);
|
|
126 break;
|
|
127 case FRAME_RATE * 37:
|
|
128 Putenemy(1, 256, 1088, 0, -1, chara_state5);
|
|
129 Putenemy(1, 1280 - 256 - 128, 1088, 0, -1, chara_state5);
|
|
130 break;
|
|
131 case FRAME_RATE * 38:
|
|
132 Putenemy(2, 256, 1088, 0, -1, chara_state5);
|
|
133 Putenemy(2, 1280 - 256 - 128, 1088, 0, -1, chara_state5);
|
|
134 break;
|
|
135 case FRAME_RATE * 39:
|
|
136 Putenemy(1, 256, 1088, 0, -1, chara_state5);
|
|
137 Putenemy(1, 1280 - 256 - 128, 1088, 0, -1, chara_state5);
|
|
138 break;
|
|
139
|
|
140 case FRAME_RATE * 50:
|
|
141 Putenemy(40, rand() % (1280 - 256) + 128, -128, 0, 1, chara_state3);
|
|
142 break;
|
|
143 case FRAME_RATE * 46:
|
|
144 Putenemy(40, rand() % (1280 - 256) + 128, -128, 0, 1, chara_state3);
|
|
145 break;
|
|
146 case FRAME_RATE * 54:
|
|
147 Putenemy(40, rand() % (1280 - 256) + 128, -128, 0, 1, chara_state3);
|
|
148 break;
|
|
149
|
|
150 case FRAME_RATE * 60:
|
|
151 Putenemy(1, 256, 1088, 0, -1, chara_state6);
|
|
152 Putenemy(1, 1280 - 256 - 128, 1088, 0, -1, chara_state6);
|
|
153 break;
|
|
154 case FRAME_RATE * 61:
|
|
155 Putenemy(1, 256, 1088, 0, -1, chara_state6);
|
|
156 Putenemy(1, 1280 - 256 - 128, 1088, 0, -1, chara_state6);
|
|
157 break;
|
|
158 case FRAME_RATE * 62:
|
|
159 Putenemy(1, 256, 1088, 0, -1, chara_state6);
|
|
160 Putenemy(1, 1280 - 256 - 128, 1088, 0, -1, chara_state6);
|
|
161 break;
|
|
162 case FRAME_RATE * 63:
|
|
163 Putenemy(1, 256, 1088, 0, -1, chara_state6);
|
|
164 Putenemy(1, 1280 - 256 - 128, 1088, 0, -1, chara_state6);
|
|
165 break;
|
|
166 case FRAME_RATE * 64:
|
|
167 Putenemy(1, 256, 1088, 0, -1, chara_state6);
|
|
168 Putenemy(1, 1280 - 256 - 128, 1088, 0, -1, chara_state6);
|
|
169 break;
|
|
170 case FRAME_RATE * 65:
|
|
171 Putenemy(40, 256, 1088, 0, -1, chara_state6);
|
|
172 Putenemy(40, 1280 - 256 - 128, 1088, 0, -1, chara_state6);
|
|
173 break;
|
|
174
|
|
175 case FRAME_RATE * 80:
|
|
176 Putenemy(42, rand() % (1280 - 256) + 128, -128, 0, 1, chara_state7);
|
|
177 break;
|
|
178 case FRAME_RATE * 66:
|
|
179 Putenemy(41, rand() % (1280 - 256) + 128, -128, 0, 1, chara_state7);
|
|
180 break;
|
|
181 case FRAME_RATE * 84:
|
|
182 Putenemy(42, rand() % (1280 - 256) + 128, -128, 0, 1, chara_state7);
|
|
183 break;
|
|
184 case FRAME_RATE * 70:
|
|
185 Putenemy(41, rand() % (1280 - 256) + 128, -128, 0, 1, chara_state7);
|
|
186 break;
|
|
187 case FRAME_RATE * 88:
|
|
188 Putenemy(42, rand() % (1280 - 256) + 128, -128, 0, 1, chara_state7);
|
|
189 break;
|
|
190 case FRAME_RATE * 74:
|
|
191 Putenemy(41, rand() % (1280 - 256) + 128, -128, 0, 1, chara_state7);
|
|
192 break;
|
|
193 case FRAME_RATE * 92:
|
|
194 Putenemy(42, rand() % (1280 - 256) + 128, -128, 0, 1, chara_state7);
|
|
195 break;
|
|
196 case FRAME_RATE * 78:
|
|
197 Putenemy(41, rand() % (1280 - 256) + 128, -128, 0, 1, chara_state7);
|
|
198 break;
|
|
199
|
|
200 case FRAME_RATE * 100:
|
|
201 Putenemy(41, 256, -128, 0, 1, chara_state7);
|
|
202 Putenemy(41, 1280 - 256 - 128, -128, 0, 1, chara_state7);
|
|
203 break;
|
|
204 case FRAME_RATE * 81:
|
|
205 Putenemy(42, 256, -128, 0, 1, chara_state7);
|
|
206 Putenemy(42, 1280 - 256 - 128, -128, 0, 1, chara_state7);
|
|
207 break;
|
|
208 case FRAME_RATE * 104:
|
|
209 Putenemy(41, 256, -128, 0, 1, chara_state7);
|
|
210 Putenemy(41, 1280 - 256 - 128, -128, 0, 1, chara_state7);
|
|
211 break;
|
|
212 case FRAME_RATE * 83:
|
|
213 Putenemy(42, 256, -128, 0, 1, chara_state7);
|
|
214 Putenemy(42, 1280 - 256 - 128, -128, 0, 1, chara_state7);
|
|
215 break;
|
|
216 case FRAME_RATE * 108:
|
|
217 Putenemy(41, 256, -128, 0, 1, chara_state7);
|
|
218 Putenemy(41, 1280 - 256 - 128, -128, 0, 1, chara_state7);
|
|
219 break;
|
|
220 case FRAME_RATE * 85:
|
|
221 Putenemy(42, 256, -128, 0, 1, chara_state7);
|
|
222 Putenemy(42, 1280 - 256 - 128, -128, 0, 1, chara_state7);
|
|
223 break;
|
|
224 case FRAME_RATE * 112:
|
|
225 Putenemy(41, 256, -128, 0, 1, chara_state7);
|
|
226 Putenemy(41, 1280 - 256 - 128, -128, 0, 1, chara_state7);
|
|
227 break;
|
|
228
|
|
229 case FRAME_RATE * 130:
|
|
230 SoundStop();
|
|
231 SoundPlay(4);
|
|
232 for(p = active_chara_list;p!=NULL;p=p->next)
|
|
233 {
|
|
234 p->f = FALSE;
|
|
235 p->state = delete_chara;
|
|
236 p->collision = noaction;
|
|
237 }
|
|
238 Putenemy(4, 520, -128, 0, 1, chara_state8); // 1面ボスをPutenemy
|
|
239 }
|
|
240 */
|
|
241 }
|
8
|
242 }
|
7
|
243 }
|
|
244
|
|
245 ObjProperty enemy[300];
|
|
246 ObjPropertyPtr e;
|
|
247
|
|
248 void
|
|
249 create_enemy(SchedTask *s, void *enemy_, void *b)
|
|
250 {
|
9
|
251 ObjPropertyPtr ene = (ObjPropertyPtr)enemy_;
|
7
|
252 SceneGraphPtr back1, enemy1;
|
9
|
253 back1 = (SceneGraphPtr)ene->parent;
|
|
254 enemy1 = (SceneGraphPtr)ene->root;
|
7
|
255
|
9
|
256 enemy1->xyz[0] = ene->x;
|
|
257 enemy1->xyz[1] = ene->y;
|
7
|
258
|
|
259 back1->addChild(enemy1);
|
8
|
260
|
7
|
261 }
|
|
262
|
|
263 void
|
|
264 Putenemy(int charano, int x, int y, int sx, int sy, int move, int coll,
|
|
265 SceneGraphPtr node, void *sgroot_)
|
|
266 {
|
|
267 SceneGraphRoot *sgroot = (SceneGraphRoot *)sgroot_;
|
|
268 SceneGraphPtr obj = (SceneGraphPtr)charactor[charano].root;
|
|
269
|
|
270 int ii = 0;
|
|
271 e = &enemy[0];
|
|
272 while ((e->flag) == 1) {
|
|
273 ii++;
|
|
274 if (ii == 100)
|
|
275 return;
|
|
276 e++;
|
|
277 }
|
|
278 e->x = x;
|
|
279 e->y = y;
|
|
280 e->vx = sx;
|
|
281 e->vy = sy;
|
9
|
282 e->root = (void*)obj;
|
|
283 e->parent = (void*)node;
|
7
|
284 e->flag = 1;
|
|
285 e->vital = charactor[charano].vital;
|
|
286 //e->move = move;
|
|
287 e->score = charactor[charano].score;
|
|
288 //e->dt1 = e->dt2 = 0;
|
|
289 //e->tama = tf;
|
|
290
|
10
|
291 int size = sizeof(ObjProperty)*16;
|
9
|
292 //printf("size = %d\n", size);
|
|
293 sgroot->set_move_task(obj, move, (void*)e, size, create_enemy);
|
7
|
294 }
|