comparison ppe/chara_state22.cc @ 34:7aaaaf5dde40

add new task.
author koba <koba@cr.ie.u-ryukyu.ac.jp>
date Fri, 07 Jan 2011 23:19:05 +0900
parents 871f7d9a2f35
children 6626e451a09d
comparison
equal deleted inserted replaced
33:39e643fc4f90 34:7aaaaf5dde40
1 #include "task_base.h" 1 #include "task_base.h"
2 #include "task_object.h" 2 #include "task_object.h"
3 3
4 SchedDefineTask(State22); 4 SchedDefineTask1(State22, state22);
5 5
6 static int 6 static int
7 run(SchedTask *smanager, void *rbuf, void *wbuf) 7 state22(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 10
11 int sf; 11 int sf = rand() % 4;
12
13 sf = rand() % 4;
14 if((sf == 0) || (sf == 1)) 12 if((sf == 0) || (sf == 1))
15 { 13 {
16 p->x = -35; 14 p->x = -35;
17 p->y = rand() % (120 - 35); 15 p->y = rand() % (120 - 35);
18 p->vx = (rand() % 4 + 1); 16 p->vx = (rand() % 4 + 1);