Mercurial > hg > Members > koba > t_dandy
view spe/chara_state28.cc @ 27:871f7d9a2f35
running.
author | koba <koba@cr.ie.u-ryukyu.ac.jp> |
---|---|
date | Mon, 27 Dec 2010 17:21:24 +0900 (2010-12-27) |
parents | c330ded6d728 |
children | f4140672ef9f |
line wrap: on
line source
#include "chara_state28.h" #include "tobject.h" SchedDefineTask(STATE28); static int run(SchedTask *smanager, void *rbuf, void *wbuf) { CHARACTER *p = (CHARACTER*)smanager->get_input(rbuf, 0); if (p->dt1 <= 360) { p->x = Mycos(p->dt1) * 30 / SANKAKU + 82 + 32; p->y = Mysin(p->dt1) * 30 / SANKAKU + 30; } if (p->dt1 > 360) { p->x = Mycos(p->dt1) * 30 * -1 / SANKAKU + 142 + 32; p->y = Mysin(p->dt1) * 30 / SANKAKU + 30; } count++; PutSprite(count, p->x - 42, p->y, 64); if (p->dt1 % 30 == 3) { Putenemy(24, p->x + 14, p->y + 14, (rand() % 5 + 0.5) * (rand() % 2 == 1 ? -1 : 1), (rand() % 5 + 0.5) * (rand() % 2 == 1 ? -1 : 1), chara_state29); } p->dt1 += 3; return 0; }