view spe/chara_state13.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_state13.h"
#include "tobject.h"

SchedDefineTask(STATE13);

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

    if(tekino0->f == FALSE){
	Bom(p->x, p->y);
	p->f = FALSE;
	p->state = delete_chara;
	p->collision = noaction;
	return 0;
    }
    
    p->x += rinkx - p->dt1;
    p->y += rinky - p->dt2;
    p->dt1 = rinkx;
    p->dt2 = rinky;
    if(rinkf2 == 1)
    {
	if(p->x > rinkx)
	{
	    Puttama(2, p->x + 32, p->y);
	}
	if(p->x < rinkx)
	{
	    Puttama(3, p->x, p->y);
	}
    }
    if(rinkf2 == 4)
    {
	count++;
	PutSprite(count, p->x, p->y + 56, 58+filpcount % 4);
    }
    if(rinkf2 == 5)
    {
	if(p->x > rinkx)
	{
	    Puttama(5, p->x + 8, p->y + 24);
	}
	if(p->x < rinkx)
	{
	    Puttama(5, p->x + 8, p->y + 24);
	}
    }
    return 0;
}