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