Mercurial > hg > Members > koba > t_dandy
diff spe/chara_state500.cc @ 18:c330ded6d728
add task file.
author | koba <koba@cr.ie.u-ryukyu.ac.jp> |
---|---|
date | Fri, 17 Dec 2010 22:18:11 +0900 |
parents | |
children | f4140672ef9f |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/spe/chara_state500.cc Fri Dec 17 22:18:11 2010 +0900 @@ -0,0 +1,42 @@ +#include "chara_state500.h" +#include "tobject.h" + +SchedDefineTask(STATE500); + +static int +run(SchedTask *smanager, void *rbuf, void *wbuf) +{ + CHARACTER *p = (CHARACTER*)smanager->get_input(rbuf, 0); + + p->s = 0; + + kyeenemyno = p; + p->dt2++; + p->dt2 %= 512; + p->dt1++; + count++; + DefSpriteEx(100, 16, 16); + // PutSprite(count, enemy[tekino].x + 16, + // enemy[tekino].y + 16, 100); + PutSpriteEx(100, p->x + 16, p->y + 16, 2, 2, p->dt1); + + if (p->dt1 % (5 + p->dt2 / 8) == 1) { + if (rand() % 2 == 1) + Putenemy(24, p->x, p->y, + (rand() % 5 + 0.5) * (rand() % 2 == + 1 ? -1 : 1), + (rand() % 5 + 0.5) * (rand() % 2 == + 1 ? -1 : 1), chara_state501); + else + Putenemy(rand() % 2 + 1, p->x, + p->y, + (int) Mycos(p->dt1 / 4) * 4 / + SANKAKU, + (int) -Mysin(p->dt1 / 4) * 4 / + SANKAKU, chara_state501); + } + if (p->dt1 == 50) { + /*Putenemy(44,0,0,1,1,411); */ + } + return 0; +}