Mercurial > hg > Members > koba > t_dandy
view ppe/chara_state5.cc @ 37:6989f8cb0259
fix.
author | koba <koba@cr.ie.u-ryukyu.ac.jp> |
---|---|
date | Sun, 09 Jan 2011 23:14:26 +0900 |
parents | 39e643fc4f90 |
children | 978097c6427a |
line wrap: on
line source
#include "task_base.h" #include "task_object.h" SchedDefineTask1(State5, state5); static int state5(SchedTask *smanager, void *rbuf, void *wbuf) { CHARACTER *p = (CHARACTER*)smanager->get_input(rbuf, 0); CHARACTER *q = (CHARACTER*)smanager->get_output(wbuf, 0); player *jiki = (player*)smanager->get_input(rbuf, 1); p->y += p->vy; p->x += p->vx; if(p->y + 96 < jiki->y && p->y + 128 > jiki->y) { p->vy = -2; p->vx = ((jiki->x > p->x) ? 4 : -4); p->task = STATE0; } else p->task = STATE5; *q = *p; return 0; }