view spe/chara_state13.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_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;
}