view spe/chara_state600.cc @ 70:cee55c8365e9 default tip

fix
author Kazuma
date Thu, 19 May 2016 18:52:26 +0900
parents c330ded6d728
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;
}