Mercurial > hg > Members > koba > t_dandy
view ppe/chara_state4.cc @ 70:cee55c8365e9 default tip
fix
author | Kazuma |
---|---|
date | Thu, 19 May 2016 18:52:26 +0900 |
parents | 39e643fc4f90 |
children | a80422eb44a9 |
line wrap: on
line source
#include "task_base.h" #include "task_object.h" SchedDefineTask1(State4, state4); static int state4(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 < jiki->y && p->y + 16 > jiki->y) { p->vy = -2; p->vx = ((jiki->x > p->x) ? 4 : -4); p->task = STATE7; } else p->task = STATE4; *q = *p; return 0; }