Mercurial > hg > Members > koba > t_dandy
view spe/chara_state6.cc @ 60:cfd42ee2ad28
change makefile, spe/task. adjust scale api. worked on ps3-ppe.
author | yutaka@localhost.localdomain |
---|---|
date | Sun, 06 Feb 2011 17:16:43 +0900 |
parents | f4140672ef9f |
children |
line wrap: on
line source
#include "task_base.h" #include "task_object.h" SchedDefineTask1(State6, state6); static int state6(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->state_task = STATE0; } else p->state_task = STATE6; *q = *p; return 0; }