Mercurial > hg > Members > koba > t_dandy
view spe/chara_state12.cc @ 27:871f7d9a2f35
running.
author | koba <koba@cr.ie.u-ryukyu.ac.jp> |
---|---|
date | Mon, 27 Dec 2010 17:21:24 +0900 |
parents | c330ded6d728 |
children | f4140672ef9f |
line wrap: on
line source
#include "chara_state12.h" #include "tobject.h" SchedDefineTask(STATE12); static int run(SchedTask *smanager, void *rbuf, void *wbuf) { CHARACTER *p = (CHARACTER*)smanager->get_input(rbuf, 0); if(fastebos > 60*60) { if(p->y > 240+32) { p->state = delete_chara; } p->y += 3; rinky += 3; count++; DefSpriteEx(54, 16, 32); PutSpriteEx(54, p->x, p->y, 2, 2, 1); p->state = chara_state12; return 0; } if(p->dt1 <= 60) { if(jiki.x + 15 - rinkx < -5) { p->vx = -0.8; } else if(jiki.x + 15 - rinkx > 5) { p->vx = +0.8; } else p->vx = 0; rinkx = p->x; rinky = p->y; } if((p->dt1 > 60) && (p->dt1 <= 70)) { if(p->dt1 % 2 == 1) { Puttama(0, rinkx - 16, rinky); Puttama(0, rinkx, rinky); Puttama(0, rinkx + 16, rinky); } } if((p->dt1 > 180) && (p->dt1 <= 240)) { if(p->dt1 % 2 == 1) { rinkf2 = 1; Puttama(2, rinkx - 16, p->y - 32); Puttama(3, rinkx + 32 - 16, p->y - 32); } else { rinkf2 = 2; } } if(p->dt1 > 240) { rinkf2 = 2; } if((p->dt1 > 240) && (p->dt1 <= 400)) { count++; PutSprite(count, rinkx - 16, rinky + 32, 58 + p->dt1 % 4); } if((p->dt1 > 300) && (p->dt1 <= 400)) { rinkf2 = 3; if(jiki.x + 15 - rinkx < -5) { p->vx = -1; } else if(jiki.x + 15 - rinkx > 5) { p->vx = +1; } else p->vx = 0; p->x += p->vx; rinkx = p->x; rinky = p->y; Puttama(4, rinkx - 8, rinky + 16); } if((p->dt1 > 400) && (p->dt1 <= 500)) { rinkf2 = 4; if(jiki.x + 15 - rinkx > 5) { p->vx = -1; } else if(jiki.x + 15 - rinkx > 5) { p->vx = +1; } else p->vx = 0; p->x += p->vx; rinkx = p->x; rinky = p->y; } if(p->dt1 > 500) { rinkf2 = 5; if(jiki.x + 15 - rinkx < -5) { p->vx = -1; } else if(jiki.x + 15 - rinkx > 5) { p->vx = +1; } else p->vx = 0; p->x += p->vx; rinkx = p->x; rinky = p->y; } if(p->dt1 > 600) { rinkf2 = 0; p->dt1 = 0; } fastebos++; p->dt1++; count++; DefSpriteEx(54, 16, 32); PutSpriteEx(54, p->x, p->y, 2, 2, 1); return 0; }