view spe/chara_state600.cc @ 18:c330ded6d728

add task file.
author koba <koba@cr.ie.u-ryukyu.ac.jp>
date Fri, 17 Dec 2010 22:18:11 +0900
parents
children f4140672ef9f
line wrap: on
line source

#include "chara_state600.h"
#include "tobject.h"

SchedDefineTask(STATE600);

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

    kyeenemyno = p;
    p->dt1 += 30;
    p->dt2++;
    p->dt1 %= 360;
    p->x += Mycos(p->dt1) * 4 / SANKAKU;
    p->y += Mysin(p->dt1) * 4 / SANKAKU;
    Puttama(11, p->x + 16, p->y + 16);
    Puttama(11, p->x + 32, p->y + 48);
    Puttama(11, p->x + 48, p->y + 16);
    if (p->dt2 > 240)
	p->task = STATE601;
    if (p->x < 0)
	p->x = 0;
    if (p->x > 260)
	p->x = 260;
    if (p->y < 0)
	p->y = 0;
    if (p->y > 232)
	p->y = 232;
    return 0;
}