view spe/chara_state602.cc @ 39:5484b8606e8e

add trace mode to tree_dandy2(GL).
author koba <koba@cr.ie.u-ryukyu.ac.jp>
date Tue, 11 Jan 2011 23:39:31 +0900
parents c330ded6d728
children f4140672ef9f
line wrap: on
line source

#include "chara_state602.h"
#include "tobject.h"

SchedDefineTask(STATE602);

static int
run(SchedTask *smanager, void *rbuf, void *wbuf)
{
    CHARACTER *p = (CHARACTER*)smanager->get_input(rbuf, 0);

    p->dt2++;
    Putenemy(24, p->x + 14, p->y + 14,
	     (rand() % 5 + 0.5) * (rand() % 2 == 1 ? -1 : 1),
	     (rand() % 5 + 0.5) * (rand() % 2 == 1 ? -1 : 1),
	     chara_state29);
    if (p->dt2 > 1024) {
	p->task = STATE600;
	p->dt2 = 0;
    }
    return 0;
}