Mercurial > hg > Members > koba > t_dandy
comparison ppe/chara_state3.cc @ 25:ee4c488d48a3
add Puttama func.
author | koba <koba@cr.ie.u-ryukyu.ac.jp> |
---|---|
date | Mon, 27 Dec 2010 02:35:06 +0900 |
parents | 5f1abbe03b9a |
children | 427e1aac0bd7 |
comparison
equal
deleted
inserted
replaced
24:86c6b3bdc763 | 25:ee4c488d48a3 |
---|---|
1 #include "task_base.h" | 1 #include "task_base.h" |
2 #include "task_object.h" | 2 #include "task_object.h" |
3 | 3 |
4 SchedDefineTask(STATE3); | 4 SchedDefineTask(State3); |
5 | 5 |
6 static int | 6 static int |
7 run(SchedTask *smanager, void *rbuf, void *wbuf) | 7 run(SchedTask *smanager, void *rbuf, void *wbuf) |
8 { | 8 { |
9 CHARACTER *p = (CHARACTER*)smanager->get_input(rbuf, 0); | 9 CHARACTER *p = (CHARACTER*)smanager->get_input(rbuf, 0); |
10 TamaContainerPtr tama = (TamaContainerPtr)smanager->get_input(rbuf, 1); | |
10 | 11 |
11 p->x += p->vx; | 12 p->x += p->vx; |
12 p->y += p->vy; | 13 p->y += p->vy; |
13 if((p->dt1 == 60) || | 14 if((p->dt1 == 60) || |
14 (p->dt1 == 90) || | 15 (p->dt1 == 90) || |
15 (p->dt1 == 30)) | 16 (p->dt1 == 30)) |
16 { | 17 { |
17 Puttama(0, p->x, p->y); | 18 Puttama(0, p->x, p->y, tama); |
18 } | 19 } |
19 p->dt1++; | 20 p->dt1++; |
20 | 21 |
21 p->task = STATE3; | 22 p->task = STATE3; |
22 smanager->swap(); | 23 smanager->swap(); |