view spe/chara_state500.cc @ 30:427e1aac0bd7

not run.
author koba <koba@cr.ie.u-ryukyu.ac.jp>
date Fri, 31 Dec 2010 15:50:44 +0900
parents c330ded6d728
children f4140672ef9f
line wrap: on
line source

#include "chara_state500.h"
#include "tobject.h"

SchedDefineTask(STATE500);

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

    p->s = 0;
    
    kyeenemyno = p;
    p->dt2++;
    p->dt2 %= 512;
    p->dt1++;
    count++;
    DefSpriteEx(100, 16, 16);
    //		PutSprite(count, enemy[tekino].x + 16,
    //  enemy[tekino].y + 16, 100);
    PutSpriteEx(100, p->x + 16, p->y + 16, 2, 2, p->dt1);
    
    if (p->dt1 % (5 + p->dt2 / 8) == 1) {
	if (rand() % 2 == 1)
	    Putenemy(24, p->x, p->y,
		     (rand() % 5 + 0.5) * (rand() % 2 ==
					   1 ? -1 : 1),
		     (rand() % 5 + 0.5) * (rand() % 2 ==
					   1 ? -1 : 1), chara_state501);
	else
	    Putenemy(rand() % 2 + 1, p->x,
		     p->y,
		     (int) Mycos(p->dt1 / 4) * 4 /
		     SANKAKU,
		     (int) -Mysin(p->dt1 / 4) * 4 /
		     SANKAKU, chara_state501);
    }
    if (p->dt1 == 50) {
	/*Putenemy(44,0,0,1,1,411); */
    }
    return 0;
}