18
|
1 #include "chara_state600.h"
|
|
2 #include "tobject.h"
|
|
3
|
|
4 SchedDefineTask(STATE600);
|
|
5
|
|
6 static int
|
|
7 run(SchedTask *smanager, void *rbuf, void *wbuf)
|
|
8 {
|
|
9 CHARACTER *p = (CHARACTER*)smanager->get_input(rbuf, 0);
|
|
10
|
|
11 kyeenemyno = p;
|
|
12 p->dt1 += 30;
|
|
13 p->dt2++;
|
|
14 p->dt1 %= 360;
|
|
15 p->x += Mycos(p->dt1) * 4 / SANKAKU;
|
|
16 p->y += Mysin(p->dt1) * 4 / SANKAKU;
|
|
17 Puttama(11, p->x + 16, p->y + 16);
|
|
18 Puttama(11, p->x + 32, p->y + 48);
|
|
19 Puttama(11, p->x + 48, p->y + 16);
|
|
20 if (p->dt2 > 240)
|
|
21 p->task = STATE601;
|
|
22 if (p->x < 0)
|
|
23 p->x = 0;
|
|
24 if (p->x > 260)
|
|
25 p->x = 260;
|
|
26 if (p->y < 0)
|
|
27 p->y = 0;
|
|
28 if (p->y > 232)
|
|
29 p->y = 232;
|
|
30 return 0;
|
|
31 }
|