Mercurial > hg > Members > koba > t_dandy
changeset 33:39e643fc4f90
moving stage1.
author | koba <koba@cr.ie.u-ryukyu.ac.jp> |
---|---|
date | Wed, 05 Jan 2011 14:41:26 +0900 |
parents | 1b161e808240 |
children | 7aaaaf5dde40 |
files | Character.c Dandy.cc ObjectType.h TaskDandy.cc ppe/Atari.cc ppe/Enemy.cc ppe/Sprite.cc ppe/chara_state0.cc ppe/chara_state1.cc ppe/chara_state10.cc ppe/chara_state11.cc ppe/chara_state12.cc ppe/chara_state13.cc ppe/chara_state2.cc ppe/chara_state3.cc ppe/chara_state4.cc ppe/chara_state5.cc ppe/chara_state6.cc ppe/chara_state7.cc ppe/chara_state8.cc ppe/chara_state9.cc ppe/tama.cc ppe/task_init.cc ppe/task_object.h property.h schedule3.c spe/chara_state8.cc state_task.cc |
diffstat | 28 files changed, 920 insertions(+), 332 deletions(-) [+] |
line wrap: on
line diff
--- a/Character.c Fri Dec 31 19:28:31 2010 +0900 +++ b/Character.c Wed Jan 05 14:41:26 2011 +0900 @@ -56,6 +56,8 @@ q[i] = (CHARACTER*)malloc(sizeof(CHARACTER)); q[i]->f = FALSE; q[i]->state = noaction; + q[i]->dt1 = 0; + q[i]->dt2 = 0; q[i]->task = 0; q[i]->collision = noaction; }
--- a/Dandy.cc Fri Dec 31 19:28:31 2010 +0900 +++ b/Dandy.cc Wed Jan 05 14:41:26 2011 +0900 @@ -530,33 +530,31 @@ m->color = (color & 32); m->mx = w / 2; m->my = h / 2; - m->tex_w = power_of_two(sptable[number].w); - m->tex_h = power_of_two(sptable[number].h); - //texMinX[number] = 0.0f; - //texMinY[number] = 0.0f; - //texMaxX[number] = (GLfloat)sptable[number].w / sptable[number].tex_w; - //texMaxY[number] = (GLfloat)sptable[number].h / sptable[number].tex_h; - // printf("texMaxX = %f, w = %d, tex_w = %d\n", texMaxX[number], sptable[number].w, sptable[number].tex_w); + m->tex_w = power_of_two(m->w); + m->tex_h = power_of_two(m->h); + m->texture = (int *)name; } +static float my_scale = 5; + void PutSprite(int zorder, short x, short y, int number) { SpriteTable *m = &sptable[number]; char *name = (char *) m->texture; -if (!name) { - printf("PutSprite %d unknown\n",number); - return; -} + if (!name) { + printf("PutSprite %d unknown\n",number); + return; + } SceneGraphPtr object = sgroot->createSceneGraph(name); - object->xyz[0] = x; - object->xyz[1] = y; + object->xyz[0] = x - object->c_xyz[0]*my_scale; + object->xyz[1] = y - object->c_xyz[1]*my_scale; object->xyz[2] = 0; root->addChild(object); - float scale[] = {5,5,1}; + float scale[] = {my_scale,my_scale,1}; /*親の回転、座標から、子の回転、座標を算出*/ get_matrix(object->matrix, object->angle, object->xyz, scale, root->matrix); /*法線用の行列。Cameraの行列を抜いている(Cameraのコンストラクタで、単位行列にしている)*/ @@ -574,8 +572,8 @@ return; } SceneGraphPtr object = sgroot->createSceneGraph(name); - object->xyz[0] = x; - object->xyz[1] = y; + object->xyz[0] = x - object->c_xyz[0]*my_scale - m->w*my_scale; + object->xyz[1] = y - object->c_xyz[0]*my_scale - m->w*my_scale; object->xyz[2] = 0; object->c_xyz[0] = m->mx; object->c_xyz[1] = m->my;
--- a/ObjectType.h Fri Dec 31 19:28:31 2010 +0900 +++ b/ObjectType.h Wed Jan 05 14:41:26 2011 +0900 @@ -1,4 +1,8 @@ enum { Tama, Enemy, + Def, + DefEx, + Put, + PutEx, };
--- a/TaskDandy.cc Fri Dec 31 19:28:31 2010 +0900 +++ b/TaskDandy.cc Wed Jan 05 14:41:26 2011 +0900 @@ -286,7 +286,6 @@ // timeprof_end(timeprof_move); state_update(); asteroidi = 0; - printf("frame = %d\n", filpcount); //charpatern(); //bosguage(); @@ -335,7 +334,7 @@ for (i = 0; i < 3; i++) { tlv3[i].y = -1; } - filpcount = 32*45; + filpcount = 0; stage = 0; //for (i = 0; i < 300; i++) //enemy[i].f = FALSE; @@ -504,7 +503,7 @@ tlv3[0].r = 0; tlv3[0].y = -1; return gamef; - // sb_size = -1; + // sb_size = -1; } } return gamef;
--- a/ppe/Atari.cc Fri Dec 31 19:28:31 2010 +0900 +++ b/ppe/Atari.cc Wed Jan 05 14:41:26 2011 +0900 @@ -1,10 +1,10 @@ #include "task_base.h" #include "task_object.h" -SchedDefineTask(Atari); +SchedDefineTask1(Atari, atari); static int -run(SchedTask *smanager, void *rbuf, void *wbuf) +atari(SchedTask *smanager, void *rbuf, void *wbuf) { int w = (int)smanager->get_param(0); int h = (int)smanager->get_param(1);
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/ppe/Enemy.cc Wed Jan 05 14:41:26 2011 +0900 @@ -0,0 +1,15 @@ +#include "task_object.h" +#include "../ObjectType.h" + + +void +Putenemy(int charano, float x, float y, float vx, float vy, int task, ObjDataPtr obj) +{ + obj->type = Enemy; + obj->charano = charano; + obj->x = x; + obj->y = y; + obj->vx = vx; + obj->vy = vy; + obj->task = task; +}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/ppe/Sprite.cc Wed Jan 05 14:41:26 2011 +0900 @@ -0,0 +1,46 @@ +#include "task_object.h" +#include "../ObjectType.h" + +void +DefSprite(int number, const char *name, float w, float h, int color, ObjDataPtr obj) +{ + obj->type = Def; + obj->number = number; + obj->w = w; + obj->h = h; + obj->color = color; +} + + +void +DefSpriteEx(int number, short middlex, short middley, ObjDataPtr obj) +{ + obj->type = DefEx; + obj->number = number; + obj->middlex = middlex; + obj->middley = middley; +} + + +void +PutSprite(int zorder, short x, short y, int number, ObjDataPtr obj) +{ + obj->type = Put; + obj->zorder = zorder; + obj->x = x; + obj->y = y; + obj->number = number; +} + + +void +PutSpriteEx(int number, int x, int y, float scalex, float scaley, float angle, ObjDataPtr obj) +{ + obj->type = PutEx; + obj->number = number; + obj->x = x; + obj->y = y; + obj->scalex = scalex; + obj->scaley = scaley; + obj->angle = angle; +}
--- a/ppe/chara_state0.cc Fri Dec 31 19:28:31 2010 +0900 +++ b/ppe/chara_state0.cc Wed Jan 05 14:41:26 2011 +0900 @@ -1,10 +1,10 @@ #include "task_base.h" #include "task_object.h" -SchedDefineTask(State0); +SchedDefineTask1(State0, state0); static int -run(SchedTask *smanager, void *rbuf, void *wbuf) +state0(SchedTask *smanager, void *rbuf, void *wbuf) { CHARACTER *p = (CHARACTER*)smanager->get_input(rbuf, 0);
--- a/ppe/chara_state1.cc Fri Dec 31 19:28:31 2010 +0900 +++ b/ppe/chara_state1.cc Wed Jan 05 14:41:26 2011 +0900 @@ -1,10 +1,10 @@ #include "task_base.h" #include "task_object.h" -SchedDefineTask(State1); +SchedDefineTask1(State1, state1); static int -run(SchedTask *smanager, void *rbuf, void *wbuf) +state1(SchedTask *smanager, void *rbuf, void *wbuf) { CHARACTER *p = (CHARACTER*)smanager->get_input(rbuf, 0);
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/ppe/chara_state10.cc Wed Jan 05 14:41:26 2011 +0900 @@ -0,0 +1,34 @@ +#include "task_base.h" +#include "task_object.h" + +SchedDefineTask1(State10, state10); + +static int +state10(SchedTask *smanager, void *rbuf, void *wbuf) +{ + int rinkx = (int)smanager->get_param(0); + int rinky = (int)smanager->get_param(1); + + CHARACTER *p = (CHARACTER*)smanager->get_input(rbuf, 0); + CHARACTER *q = (CHARACTER*)smanager->get_output(wbuf, 0); + + if(p->dt1 < 48) + { + p->x += p->vx; + p->y += p->vy; + p->dt1++; + + p->task = STATE10; + *q = *p; + return 0; + } + int *w_rinkf1 = (int*)smanager->get_output(wbuf, 1); + + *w_rinkf1 = 1; + p->dt1 = rinkx; + p->dt2 = rinky; + + p->task = STATE13; + *q = *p; + return 0; +}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/ppe/chara_state11.cc Wed Jan 05 14:41:26 2011 +0900 @@ -0,0 +1,43 @@ +#include "task_base.h" +#include "task_object.h" + +SchedDefineTask1(State11, state11); + +static int +state11(SchedTask *smanager, void *rbuf, void *wbuf) +{ + int rinkf1 = (int)smanager->get_param(0); + int count = (int)smanager->get_param(1); + int length; + CHARACTER *p = (CHARACTER*)smanager->get_input(rbuf, 0); + + if(rinkf1 == 0) + { + length = 2; + smanager->set_outputSize(2, sizeof(ObjContainer)+sizeof(ObjData)*(length-1)); + smanager->setup_outputData(); + + CHARACTER *q = (CHARACTER*)smanager->get_output(wbuf, 0); + int *w_count = (int*)smanager->get_output(wbuf, 1); + ObjContainerPtr sprite = (ObjContainerPtr)smanager->get_output(wbuf, 2); + sprite->flag = true; + sprite->length = length; + + count++; + DefSpriteEx(54, 16, 32, &sprite->data[0]); + PutSpriteEx(54, p->x, p->y, p->s, p->s, 1, &sprite->data[1]); + + p->task = STATE11; + *w_count = count; + *q = *p; + return 0; + } + CHARACTER *q = (CHARACTER*)smanager->get_output(wbuf, 0); + + p->dt1 = 0; + p->dt2 = 0; + + p->task = STATE12; + *q = *p; + return 0; +}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/ppe/chara_state12.cc Wed Jan 05 14:41:26 2011 +0900 @@ -0,0 +1,212 @@ +#include "task_base.h" +#include "task_object.h" + +SchedDefineTask1(State12, state12); + +static int +state12(SchedTask *smanager, void *rbuf, void *wbuf) +{ + int fastebos = (int)smanager->get_param(0); + int count = (int)smanager->get_param(1); + int rinkx = (int)smanager->get_param(2); + int rinky = (int)smanager->get_param(3); + + CHARACTER *p = (CHARACTER*)smanager->get_input(rbuf, 0); + int length; + int rinkf2; + int index_count = 0; + + if (fastebos > 60*60) { + length = 2; + smanager->set_outputSize(6, sizeof(ObjContainer)+sizeof(ObjData)*(length-1)); + smanager->setup_outputData(); + + CHARACTER *q = (CHARACTER*)smanager->get_output(wbuf, 0); + int *w_count = (int*)smanager->get_output(wbuf, 3); + int *w_rinky = (int*)smanager->get_output(wbuf, 4); + ObjContainerPtr sprite = (ObjContainerPtr)smanager->get_output(wbuf, 6); + sprite->flag = true; + sprite->length = length; + + if (p->y > 240+32) { + p->task = DELETE_CHARA; + } + p->y += 3; + rinky += 3; + count++; + + DefSpriteEx(54, 16, 32, &sprite->data[index_count]); + index_count++; + PutSpriteEx(54, p->x, p->y, 2, 2, 1, &sprite->data[index_count]); + + *w_rinky = rinky; + *w_count = count; + *q = *p; + p->task = STATE12; + return 0; + } + + player *jiki = (player*)smanager->get_input(rbuf, 1); + + if (p->dt1 <= 60) { + length = 2; + smanager->set_outputSize(6, sizeof(ObjContainer)+sizeof(ObjData)*(length-1)); + smanager->setup_outputData(); + + 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) { + length = 5; + smanager->set_outputSize(6, sizeof(ObjContainer)+sizeof(ObjData)*(length-1)); + smanager->setup_outputData(); + + ObjContainerPtr sprite = (ObjContainerPtr)smanager->get_output(wbuf, 6); + sprite->flag = true; + sprite->length = length; + + Puttama(0, rinkx - 16, rinky, &sprite->data[index_count]); + index_count++; + Puttama(0, rinkx, rinky, &sprite->data[index_count]); + index_count++; + Puttama(0, rinkx + 16, rinky, &sprite->data[index_count]); + index_count++; + } else { + length = 2; + smanager->set_outputSize(6, sizeof(ObjContainer)+sizeof(ObjData)*(length-1)); + smanager->setup_outputData(); + } + } + + if ((p->dt1 > 70) && (p->dt1 <= 180)) { + length = 2; + smanager->set_outputSize(6, sizeof(ObjContainer)+sizeof(ObjData)*(length-1)); + smanager->setup_outputData(); + } + + if ((p->dt1 > 180) && (p->dt1 <= 240)) { + if (p->dt1 % 2 == 1) { + length = 4; + smanager->set_outputSize(6, sizeof(ObjContainer)+sizeof(ObjData)*(length-1)); + smanager->setup_outputData(); + + ObjContainerPtr sprite = (ObjContainerPtr)smanager->get_output(wbuf, 6); + + rinkf2 = 1; + Puttama(2, rinkx - 16, p->y - 32, &sprite->data[index_count]); + index_count++; + Puttama(3, rinkx + 32 - 16, p->y - 32, &sprite->data[index_count]); + index_count++; + } else { + length = 2; + smanager->set_outputSize(6, sizeof(ObjContainer)+sizeof(ObjData)*(length-1)); + smanager->setup_outputData(); + + rinkf2 = 2; + } + } + + if (p->dt1 > 240) { + rinkf2 = 2; + } + + if ((p->dt1 > 240) && (p->dt1 <= 400)) { + length = 4; + smanager->set_outputSize(6, sizeof(ObjContainer)+sizeof(ObjData)*(length-1)); + smanager->setup_outputData(); + + ObjContainerPtr sprite = (ObjContainerPtr)smanager->get_output(wbuf, 6); + + count++; + PutSprite(count, rinkx - 16, rinky + 32, 58 + p->dt1 % 4, &sprite->data[index_count]); + index_count++; + + if (p->dt1 > 300) { + 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, &sprite->data[index_count]); + index_count++; + } + } + + if (p->dt1 > 400) { + length = 2; + smanager->set_outputSize(6, sizeof(ObjContainer)+sizeof(ObjData)*(length-1)); + smanager->setup_outputData(); + } + + 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; + } + CHARACTER *q = (CHARACTER*)smanager->get_output(wbuf, 0); + int *w_count = (int*)smanager->get_output(wbuf, 1); + int *w_fastebos = (int*)smanager->get_output(wbuf, 2); + int *w_rinkx = (int*)smanager->get_output(wbuf, 3); + int *w_rinky = (int*)smanager->get_output(wbuf, 4); + int *w_rinkf2 = (int*)smanager->get_output(wbuf, 5); + ObjContainerPtr sprite = (ObjContainerPtr)smanager->get_output(wbuf, 6); + sprite->flag = true; + sprite->length = length; + + fastebos++; + p->dt1++; + count++; + + DefSpriteEx(54, 16, 32, &sprite->data[index_count]); + index_count++; + PutSpriteEx(54, p->x, p->y, 2, 2, 1, &sprite->data[index_count]); + + *w_count = count; + *w_fastebos = fastebos; + *w_rinkx = rinkx; + *w_rinky = rinky; + *w_rinkf2 = rinkf2; + *q = *p; + return 0; +}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/ppe/chara_state13.cc Wed Jan 05 14:41:26 2011 +0900 @@ -0,0 +1,86 @@ +#include "task_base.h" +#include "task_object.h" + +SchedDefineTask1(State13, state13); + +static int +state13(SchedTask *smanager, void *rbuf, void *wbuf) +{ + int rinkx = (int)smanager->get_param(0); + int rinky = (int)smanager->get_param(1); + int rinkf2 = (int)smanager->get_param(2); + int count = (int)smanager->get_param(3); + int filpcount = (int)smanager->get_param(4); + int flag = (int)smanager->get_param(5); + int bomend = (int)smanager->get_param(6); + + int length; + CHARACTER *p = (CHARACTER*)smanager->get_input(rbuf, 0); + + if(flag == FALSE){ + bomchar *bchar = (bomchar*)smanager->get_input(rbuf, 1); + CHARACTER *q = (CHARACTER*)smanager->get_output(wbuf, 0); + int *o_bomend = (int*)smanager->get_output(wbuf, 2); + Bom(p->x, p->y, &bomend, bchar); + p->f = FALSE; + p->task = DELETE_CHARA; + + *o_bomend = bomend; + *q = *p; + return 0; + } + length = 1; + smanager->set_outputSize(3, sizeof(ObjContainer)+sizeof(ObjData)*(length-1)); + smanager->setup_outputData(); + + CHARACTER *q = (CHARACTER*)smanager->get_output(wbuf, 0); + ObjContainerPtr sprite = (ObjContainerPtr)smanager->get_output(wbuf, 3); + sprite->flag = false; + + p->x += rinkx - p->dt1; + p->y += rinky - p->dt2; + p->dt1 = rinkx; + p->dt2 = rinky; + if(rinkf2 == 1) + { + if(p->x > rinkx) + { + sprite->flag = true; + sprite->length = length; + Puttama(2, p->x + 32, p->y, &sprite->data[0]); + } + if(p->x < rinkx) + { + sprite->flag = true; + sprite->length = length; + Puttama(3, p->x, p->y, &sprite->data[0]); + } + } + if(rinkf2 == 4) + { + int *o_count = (int*)smanager->get_output(wbuf, 1); + sprite->flag = true; + sprite->length = length; + count++; + *o_count = count; + PutSprite(count, p->x, p->y + 56, 58+filpcount % 4, &sprite->data[0]); + } + if(rinkf2 == 5) + { + if(p->x > rinkx) + { + sprite->flag = true; + sprite->length = length; + Puttama(5, p->x + 8, p->y + 24, &sprite->data[0]); + } + if(p->x < rinkx) + { + sprite->flag = true; + sprite->length = length; + Puttama(5, p->x + 8, p->y + 24, &sprite->data[0]); + } + } + + *q = *p; + return 0; +}
--- a/ppe/chara_state2.cc Fri Dec 31 19:28:31 2010 +0900 +++ b/ppe/chara_state2.cc Wed Jan 05 14:41:26 2011 +0900 @@ -1,10 +1,10 @@ #include "task_base.h" #include "task_object.h" -SchedDefineTask(State2); +SchedDefineTask1(State2, state2); static int -run(SchedTask *smanager, void *rbuf, void *wbuf) +state2(SchedTask *smanager, void *rbuf, void *wbuf) { CHARACTER *p = (CHARACTER*)smanager->get_input(rbuf, 0);
--- a/ppe/chara_state3.cc Fri Dec 31 19:28:31 2010 +0900 +++ b/ppe/chara_state3.cc Wed Jan 05 14:41:26 2011 +0900 @@ -2,13 +2,13 @@ #include "task_object.h" #include "../ObjectType.h" -SchedDefineTask(State3); +SchedDefineTask1(State3, state3); static int -run(SchedTask *smanager, void *rbuf, void *wbuf) +state3(SchedTask *smanager, void *rbuf, void *wbuf) { CHARACTER *p = (CHARACTER*)smanager->get_input(rbuf, 0); - int length = 3; + int length = 1; smanager->set_outputSize(1, sizeof(ObjContainer)+sizeof(ObjData)*(length-1)); smanager->setup_outputData(); @@ -24,12 +24,9 @@ (p->dt1 == 30)) { tama->flag = true; - tama->type = Tama; tama->length = length; Puttama(0, p->x, p->y, &tama->data[0]); - Puttama(0, p->x, p->y, &tama->data[1]); - Puttama(0, p->x, p->y, &tama->data[2]); } p->dt1++; p->task = STATE3;
--- a/ppe/chara_state4.cc Fri Dec 31 19:28:31 2010 +0900 +++ b/ppe/chara_state4.cc Wed Jan 05 14:41:26 2011 +0900 @@ -1,10 +1,10 @@ #include "task_base.h" #include "task_object.h" -SchedDefineTask(State4); +SchedDefineTask1(State4, state4); static int -run(SchedTask *smanager, void *rbuf, void *wbuf) +state4(SchedTask *smanager, void *rbuf, void *wbuf) { CHARACTER *p = (CHARACTER*)smanager->get_input(rbuf, 0); CHARACTER *q = (CHARACTER*)smanager->get_output(wbuf, 0);
--- a/ppe/chara_state5.cc Fri Dec 31 19:28:31 2010 +0900 +++ b/ppe/chara_state5.cc Wed Jan 05 14:41:26 2011 +0900 @@ -1,10 +1,10 @@ #include "task_base.h" #include "task_object.h" -SchedDefineTask(State5); +SchedDefineTask1(State5, state5); static int -run(SchedTask *smanager, void *rbuf, void *wbuf) +state5(SchedTask *smanager, void *rbuf, void *wbuf) { CHARACTER *p = (CHARACTER*)smanager->get_input(rbuf, 0); CHARACTER *q = (CHARACTER*)smanager->get_output(wbuf, 0);
--- a/ppe/chara_state6.cc Fri Dec 31 19:28:31 2010 +0900 +++ b/ppe/chara_state6.cc Wed Jan 05 14:41:26 2011 +0900 @@ -1,10 +1,10 @@ #include "task_base.h" #include "task_object.h" -SchedDefineTask(State6); +SchedDefineTask1(State6, state6); static int -run(SchedTask *smanager, void *rbuf, void *wbuf) +state6(SchedTask *smanager, void *rbuf, void *wbuf) { CHARACTER *p = (CHARACTER*)smanager->get_input(rbuf, 0); CHARACTER *q = (CHARACTER*)smanager->get_output(wbuf, 0);
--- a/ppe/chara_state7.cc Fri Dec 31 19:28:31 2010 +0900 +++ b/ppe/chara_state7.cc Wed Jan 05 14:41:26 2011 +0900 @@ -1,11 +1,10 @@ #include "task_base.h" #include "task_object.h" -#include "../ObjectType.h" -SchedDefineTask(State7); +SchedDefineTask1(State7, state7); static int -run(SchedTask *smanager, void *rbuf, void *wbuf) +state7(SchedTask *smanager, void *rbuf, void *wbuf) { CHARACTER *p = (CHARACTER*)smanager->get_input(rbuf, 0); int length = 1; @@ -15,7 +14,7 @@ CHARACTER *q = (CHARACTER*)smanager->get_output(wbuf, 0); ObjContainerPtr tama = (ObjContainerPtr)smanager->get_output(wbuf, 1); - tama->flag = false; + tama->flag = false; p->x += p->vx; p->y += p->vy; @@ -23,9 +22,7 @@ || (p->dt1 == 30)) { tama->flag = true; - tama->type = Tama; - tama->length = length; - + tama->length = 1; Puttama(1, p->x, p->y, &tama->data[0]); }
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/ppe/chara_state8.cc Wed Jan 05 14:41:26 2011 +0900 @@ -0,0 +1,45 @@ +#include "task_base.h" +#include "task_object.h" + +SchedDefineTask1(State8, state8); + +static int +state8(SchedTask *smanager, void *rbuf, void *wbuf) +{ + int count = (int)smanager->get_param(0); + CHARACTER *p = (CHARACTER*)smanager->get_input(rbuf, 0); + int length; + + if(p->y < 520) + { + length = 2; + smanager->set_outputSize(2, sizeof(ObjContainer)+sizeof(ObjData)*(length-1)); + smanager->setup_outputData(); + + CHARACTER *q = (CHARACTER*)smanager->get_output(wbuf, 0); + int *w_count = (int*)smanager->get_output(wbuf, 1); + ObjContainerPtr sprite = (ObjContainerPtr)smanager->get_output(wbuf, 2); + sprite->flag = true; + sprite->length = length; + + p->y += p->vy; + count++; + + DefSpriteEx(p->charano, 16*4, 32*4, &sprite->data[0]); + PutSpriteEx(p->charano, (p->x * 4), (p->y * 4), 0.2, 0.2, 1, &sprite->data[1]); + + p->dt1 = 512; + p->s = 0.125; + p->task = STATE8; + + *w_count = count; + *q = *p; + return 0; + } + + CHARACTER *q = (CHARACTER*)smanager->get_output(wbuf, 0); + p->task = STATE9; + + *q = *p; + return 0; +}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/ppe/chara_state9.cc Wed Jan 05 14:41:26 2011 +0900 @@ -0,0 +1,64 @@ +#include "task_base.h" +#include "task_object.h" + +SchedDefineTask1(State9, state9); + +static int +state9(SchedTask *smanager, void *rbuf, void *wbuf) +{ + int count = (int)smanager->get_param(0); + CHARACTER *p = (CHARACTER*)smanager->get_input(rbuf, 0); + int length; + + if(p->s <= 2) + { + length = 2; + smanager->set_outputSize(4, sizeof(ObjContainer)+sizeof(ObjData)*(length-1)); + smanager->setup_outputData(); + + CHARACTER *q = (CHARACTER*)smanager->get_output(wbuf, 0); + int *w_count = (int*)smanager->get_output(wbuf, 1); + ObjContainerPtr sprite = (ObjContainerPtr)smanager->get_output(wbuf, 4); + sprite->flag = true; + sprite->length = length; + + p->s += 0.05; + p->y -= 12; + + count++; + *w_count = count; + + DefSpriteEx(54, 16*4, 32*4, &sprite->data[0]); + PutSpriteEx(54, (p->x * 4), (p->y * 4), p->s, p->s, 1, &sprite->data[1]); + + p->task = STATE9; + *q = *p; + return 0; + } + length = 4; + smanager->set_outputSize(4, sizeof(ObjContainer)+sizeof(ObjData)*(length-1)); + smanager->setup_outputData(); + + CHARACTER *q = (CHARACTER*)smanager->get_output(wbuf, 0); + int *w_rinkx = (int*)smanager->get_output(wbuf, 2); + int *w_rinky = (int*)smanager->get_output(wbuf, 3); + ObjContainerPtr sprite = (ObjContainerPtr)smanager->get_output(wbuf, 4); + sprite->flag = true; + sprite->length = length; + + count++; + + + DefSpriteEx(54, 16, 32, &sprite->data[0]); + PutSpriteEx(54, p->x, p->y, p->s, p->s, 1, &sprite->data[1]); + *w_rinkx = p->x; + *w_rinky = p->y; + Putenemy(5, *w_rinkx - 16, *w_rinky - 16, 1, 0, STATE10, &sprite->data[2]); + Putenemy(5, *w_rinkx - 16, *w_rinky - 16, -1, 0, STATE10, &sprite->data[3]); + p->dt1 = 8192; + + p->task = STATE11; + + *q = *p; + return 0; +}
--- a/ppe/tama.cc Fri Dec 31 19:28:31 2010 +0900 +++ b/ppe/tama.cc Wed Jan 05 14:41:26 2011 +0900 @@ -1,8 +1,9 @@ #include "task_object.h" - +#include "../ObjectType.h" void Puttama(int type, float x, float y, ObjDataPtr tama) { + tama->type = Tama; tama->tama_type = type; tama->x = x; tama->y = y;
--- a/ppe/task_init.cc Fri Dec 31 19:28:31 2010 +0900 +++ b/ppe/task_init.cc Wed Jan 05 14:41:26 2011 +0900 @@ -12,6 +12,12 @@ SchedExternTask(State5); SchedExternTask(State6); SchedExternTask(State7); +SchedExternTask(State8); +SchedExternTask(State9); +SchedExternTask(State10); +SchedExternTask(State11); +SchedExternTask(State12); +SchedExternTask(State13); SchedExternTask(State20); SchedExternTask(State21); @@ -36,6 +42,12 @@ SchedRegisterTask(STATE5, State5); SchedRegisterTask(STATE6, State6); SchedRegisterTask(STATE7, State7); + SchedRegisterTask(STATE8, State8); + SchedRegisterTask(STATE9, State9); + SchedRegisterTask(STATE10, State10); + SchedRegisterTask(STATE11, State11); + SchedRegisterTask(STATE12, State12); + SchedRegisterTask(STATE13, State13); SchedRegisterTask(STATE20, State20); SchedRegisterTask(STATE21, State21);
--- a/ppe/task_object.h Fri Dec 31 19:28:31 2010 +0900 +++ b/ppe/task_object.h Wed Jan 05 14:41:26 2011 +0900 @@ -110,27 +110,37 @@ } CollisionProperty, *CollisionPropertyPtr; typedef struct ObjData { + int type; + int tama_type; int charano; int task; - + int zorder; + int number; + int color; + float angle; float x, y; float vx, vy; + float w, h; + float scalex, scaley; + short middlex, middley; } ObjData, *ObjDataPtr; typedef struct ObjContainer { bool flag; int length; - int type; ObjData data[1]; } ObjContainer, *ObjContainerPtr; - CHARACTER * noaction(CHARACTER *p); CHARACTER * delete_chara(CHARACTER *p); void Bom(int x, int y, int *bomend, bomchar *bchar); void Puttama(int type, float x, float y, ObjDataPtr tama); -void Putenemy(int charano, float x, float y, float vx, float vy, int task); +void Putenemy(int charano, float x, float y, float vx, float vy, int task, ObjDataPtr obj); +void PutSprite(int zorder, short x, short y, int number, ObjDataPtr obj); +void DefSprite(int number, const char *name, float w, float h, int color, ObjDataPtr obj); +void DefSpriteEx(int number, short middlex, short middley, ObjDataPtr obj); +void PutSpriteEx(int number, int x, int y, float scalex, float scaley, float angle, ObjDataPtr obj); #endif
--- a/property.h Fri Dec 31 19:28:31 2010 +0900 +++ b/property.h Wed Jan 05 14:41:26 2011 +0900 @@ -25,21 +25,38 @@ } CollisionProperty, *CollisionPropertyPtr; + typedef struct ObjData { + int type; + int tama_type; int charano; int task; - + int zorder; + int number; + int color; + float angle; float x, y; float vx, vy; + float w, h; + float scalex, scaley; + short middlex, middley; } ObjData, *ObjDataPtr; typedef struct ObjContainer { bool flag; int length; - int type; ObjData data[1]; } ObjContainer, *ObjContainerPtr; + +typedef struct Boss1Property { + int count; + int fastebos; + int rinkx; + int rinky; + int rinkf2; +} Boss1Property, *Boss1PropertyPtr; + #endif
--- a/schedule3.c Fri Dec 31 19:28:31 2010 +0900 +++ b/schedule3.c Wed Jan 05 14:41:26 2011 +0900 @@ -228,7 +228,7 @@ Putenemy(41, 256, -128, 0, 1, chara_state7); Putenemy(41, 1280 - 256 - 128, -128, 0, 1, chara_state7); break; -#if 0 + case FRAME_RATE * 130: SoundStop(); SoundPlay(4); @@ -239,7 +239,6 @@ p->collision = noaction; } Putenemy(4, 520, -128, 0, 1, chara_state8); // 1面ボスをPutenemy -#endif } //case文 #if 0
--- a/spe/chara_state8.cc Fri Dec 31 19:28:31 2010 +0900 +++ b/spe/chara_state8.cc Wed Jan 05 14:41:26 2011 +0900 @@ -1,13 +1,22 @@ -#include "chara_state8.h" -#include "tobject.h" +#include "task_base.h" +#include "task_object.h" -SchedDefineTask(STATE8); +SchedDefineTask1(STATE8, state8); static int -run(SchedTask *smanager, void *rbuf, void *wbuf) +state8(SchedTask *smanager, void *rbuf, void *wbuf) { CHARACTER *p = (CHARACTER*)smanager->get_input(rbuf, 0); + int length = 2; + smanager->set_outputSize(1, sizeof(ObjContainer)+sizeof(ObjData)*(length-1)); + smanager->setup_outputData(); + + CHARACTER *q = (CHARACTER*)smanager->get_output(wbuf, 0); + ObjContainerPtr sprite = (ObjContainerPtr)smanager->get_output(wbuf, 1); + sprite->flag = false; + +#if 0 if(p->y < 520) { tekino0 = p; @@ -21,6 +30,8 @@ p->task = STATE8; return 0; } +#endif + p->task = STATE9; return 0; }
--- a/state_task.cc Fri Dec 31 19:28:31 2010 +0900 +++ b/state_task.cc Wed Jan 05 14:41:26 2011 +0900 @@ -21,17 +21,17 @@ extern SpriteTable sptable[DEFOBJ]; extern TaskManager *tmanager; -CHARACTER *kyeenemyno; -CHARACTER *tekino0; -CHARACTER *enemy_part1; -CHARACTER *enemy_part2; -CHARACTER *enemy_part3; -CHARACTER *enemy_part4; -CHARACTER *enemy_part5; +CHARACTER *kyeenemyno = NULL; +CHARACTER *tekino0 = NULL; +CHARACTER *enemy_part1 = NULL; +CHARACTER *enemy_part2 = NULL; +CHARACTER *enemy_part3 = NULL; +CHARACTER *enemy_part4 = NULL; +CHARACTER *enemy_part5 = NULL; //int tekino0; -int rinkx; -int rinky; +int rinkx = 0; +int rinky = 0; int rinkf1 = 0, rinkf2 = 0; CHARACTER *asteroiddt[200]; int asteroidi = 0; @@ -68,14 +68,13 @@ SetTaskState(STATE5, chara_state5); SetTaskState(STATE6, chara_state6); SetTaskState(STATE7, chara_state7); -#if 0 SetTaskState(STATE8, chara_state8); SetTaskState(STATE9, chara_state9); SetTaskState(STATE10, chara_state10); SetTaskState(STATE11, chara_state11); SetTaskState(STATE12, chara_state12); SetTaskState(STATE13, chara_state13); -#endif + SetTaskState(STATE20, chara_state20); SetTaskState(STATE21, chara_state21); SetTaskState(STATE22, chara_state22); @@ -128,23 +127,34 @@ if (new_obj->flag == true) { int length = new_obj->length; - int type = new_obj->type; - switch(type) { - case Tama: - for(int i=0; i < length; i++) { - ObjDataPtr data = &new_obj->data[i]; - Puttama(data->tama_type, data->x, data->y); + for (int i=0; i < length; i++) { + ObjDataPtr obj_data = &new_obj->data[i]; + int type = obj_data->type; + + switch (type) { + case Tama: + Puttama(obj_data->tama_type, obj_data->x, obj_data->y); + break; + case Enemy: { + int task_num = GetStateNum(obj_data->task); + Putenemy(obj_data->charano, obj_data->x, obj_data->y, + obj_data->vx, obj_data->vy, state_list[task_num]); + break; } - break; - case Enemy: - for(int i=0; i < length; i++) { - ObjDataPtr data = &new_obj->data[i]; - int task_num = GetStateNum(data->task); - Putenemy(data->charano, data->x, data->y, data->vx, data->vy, - state_list[task_num]); - } - break; + case Def: + break; + case DefEx: + DefSpriteEx(obj_data->number, obj_data->middlex, obj_data->middley); + break; + case Put: + PutSprite(obj_data->zorder, obj_data->x, obj_data->y, obj_data->number); + break; + case PutEx: + PutSpriteEx(obj_data->number, obj_data->x, obj_data->y, + obj_data->scalex, obj_data->scaley, obj_data->angle); + break; + } } } int num = GetStateNum(p->task); @@ -159,11 +169,12 @@ { int task_num = p->task; HTaskPtr state_task = tmanager->create_task(task_num); - + state_task->set_inData(0, p, sizeof(CHARACTER)); + state_task->set_outData(0, p, sizeof(CHARACTER)); + state_task->set_post(updateState, (void*)p, NULL); - state_task->set_cpu(SPE_ANY); state_task->spawn(); @@ -179,9 +190,87 @@ state_task->set_inData(0, p, sizeof(CHARACTER)); state_task->set_inData(1, &jiki, sizeof(player)); + state_task->set_outData(0, p, sizeof(CHARACTER)); + state_task->set_post(updateState, (void*)p, NULL); + state_task->set_cpu(SPE_ANY); + state_task->spawn(); + return p; +} + + +CHARACTER* +sendContainerTask(CHARACTER *p) +{ + int task_num = p->task; + int obj_size = sizeof(ObjContainer)+sizeof(ObjData)*DATA_LENGTH; + HTaskPtr state_task = tmanager->create_task(task_num); + ObjContainerPtr obj = (ObjContainerPtr)tmanager->allocate(obj_size); + obj->flag = false; + obj->length = 0; + + state_task->set_inData(0, p, sizeof(CHARACTER)); + + state_task->set_outData(0, p, sizeof(CHARACTER)); + state_task->set_outData(1, obj, 0); + + state_task->set_post(checkContainer, (void*)p, (void*)obj); + state_task->set_cpu(SPE_ANY); + state_task->spawn(); + + return p; +} + + +CHARACTER* +BossTask1(CHARACTER *p) +{ + int task_num = p->task; + int obj_size = sizeof(ObjContainer)+sizeof(ObjData)*DATA_LENGTH; + HTaskPtr state_task = tmanager->create_task(task_num); + ObjContainerPtr obj = (ObjContainerPtr)tmanager->allocate(obj_size); + obj->flag = false; + obj->length = 0; + + state_task->set_param(0, (memaddr)count); + + state_task->set_inData(0, p, sizeof(CHARACTER)); + + state_task->set_outData(0, p, sizeof(CHARACTER)); + state_task->set_outData(1, &count, sizeof(int)); + state_task->set_outData(2, obj, 0); + + state_task->set_post(checkContainer, (void*)p, (void*)obj); + state_task->set_cpu(SPE_ANY); + state_task->spawn(); + + return p; +} + + +CHARACTER* +BossTask2(CHARACTER *p) +{ + int task_num = p->task; + int obj_size = sizeof(ObjContainer)+sizeof(ObjData)*DATA_LENGTH; + HTaskPtr state_task = tmanager->create_task(task_num); + ObjContainerPtr obj = (ObjContainerPtr)tmanager->allocate(obj_size); + obj->flag = false; + obj->length = 0; + + state_task->set_param(0, (memaddr)count); + + state_task->set_inData(0, p, sizeof(CHARACTER)); + + state_task->set_outData(0, p, sizeof(CHARACTER)); + state_task->set_outData(1, &count, sizeof(int)); + state_task->set_outData(2, &rinkx, sizeof(int)); + state_task->set_outData(3, &rinky, sizeof(int)); + state_task->set_outData(4, obj, 0); + + state_task->set_post(checkContainer, (void*)p, (void*)obj); state_task->set_cpu(SPE_ANY); state_task->spawn(); @@ -190,21 +279,115 @@ CHARACTER* -putTamaTask1(CHARACTER *p) +BossTask3(CHARACTER *p) +{ + int task_num = p->task; + HTaskPtr state_task = tmanager->create_task(task_num); + + state_task->set_param(0, (memaddr)rinkx); + state_task->set_param(1, (memaddr)rinky); + + state_task->set_inData(0, p, sizeof(CHARACTER)); + + state_task->set_outData(0, p, sizeof(CHARACTER)); + state_task->set_outData(1, &rinkf1, sizeof(int)); + + state_task->set_post(updateState, (void*)p, NULL); + state_task->set_cpu(SPE_ANY); + state_task->spawn(); + + return p; +} + + +CHARACTER* +BossTask4(CHARACTER *p) +{ + int task_num = p->task; + int obj_size = sizeof(ObjContainer)+sizeof(ObjData)*DATA_LENGTH; + HTaskPtr state_task = tmanager->create_task(task_num); + ObjContainerPtr obj = (ObjContainerPtr)tmanager->allocate(obj_size); + obj->flag = false; + obj->length = 0; + + state_task->set_param(0, (memaddr)rinkf1); + state_task->set_param(1, (memaddr)count); + + state_task->set_inData(0, p, sizeof(CHARACTER)); + + state_task->set_outData(0, p, sizeof(CHARACTER)); + state_task->set_outData(1, &count, sizeof(int)); + state_task->set_outData(2, obj, 0); + + state_task->set_post(checkContainer, (void*)p, (void*)obj); + state_task->set_cpu(SPE_ANY); + state_task->spawn(); + + return p; +} + + +CHARACTER* +BossTask5(CHARACTER *p) { int task_num = p->task; int obj_size = sizeof(ObjContainer)+sizeof(ObjData)*DATA_LENGTH; HTaskPtr state_task = tmanager->create_task(task_num); ObjContainerPtr obj = (ObjContainerPtr)tmanager->allocate(obj_size); + obj->flag = false; obj->length = 0; + state_task->set_param(0, (memaddr)fastebos); + state_task->set_param(1, (memaddr)count); + state_task->set_param(2, (memaddr)rinkx); + state_task->set_param(3, (memaddr)rinky); + + state_task->set_inData(0, p, sizeof(CHARACTER)); + state_task->set_inData(1, &jiki, sizeof(player)); + + state_task->set_outData(0, p, sizeof(CHARACTER)); + state_task->set_outData(1, &count, sizeof(int)); + state_task->set_outData(2, &fastebos, sizeof(int)); + state_task->set_outData(3, &rinkx, sizeof(int)); + state_task->set_outData(4, &rinky, sizeof(int)); + state_task->set_outData(5, &rinkf2, sizeof(int)); + state_task->set_outData(6, obj, 0); + + state_task->set_post(checkContainer, (void*)p, (void*)obj); + state_task->set_cpu(SPE_ANY); + state_task->spawn(); + + return p; +} + + +CHARACTER* +BossTask6(CHARACTER *p) +{ + int task_num = p->task; + int obj_size = sizeof(ObjContainer)+sizeof(ObjData)*DATA_LENGTH; + HTaskPtr state_task = tmanager->create_task(task_num); + ObjContainerPtr obj = (ObjContainerPtr)tmanager->allocate(obj_size); + obj->flag = false; + obj->length = 0; + + state_task->set_param(0, (memaddr)rinkx); + state_task->set_param(1, (memaddr)rinky); + state_task->set_param(2, (memaddr)rinkf2); + state_task->set_param(3, (memaddr)count); + state_task->set_param(4, (memaddr)filpcount); + state_task->set_param(5, (memaddr)tekino0->f); + state_task->set_param(6, (memaddr)bomend); + state_task->set_inData(0, p, sizeof(CHARACTER)); - + state_task->set_inData(1, bchar, sizeof(bomchar)*(bomend+1)); + state_task->set_outData(0, p, sizeof(CHARACTER)); - state_task->set_outData(1, obj, 0); + state_task->set_outData(1, &count, sizeof(int)); + state_task->set_outData(2, &bomend, sizeof(int)); + state_task->set_outData(3, obj, 0); state_task->set_post(checkContainer, (void*)p, (void*)obj); - state_task->set_cpu(SPE_ANY); state_task->spawn(); @@ -219,6 +402,7 @@ return p; } + CHARACTER* delete_chara(CHARACTER *p) { @@ -230,6 +414,7 @@ return parent; } + CHARACTER* chara_state0(CHARACTER *p) { @@ -237,6 +422,7 @@ return SimpleStateTask(p); } + CHARACTER* chara_state1(CHARACTER *p) { @@ -244,6 +430,7 @@ return SimpleStateTask(p); } + CHARACTER* chara_state2(CHARACTER *p) { @@ -251,13 +438,15 @@ return SimpleStateTask(p); } + CHARACTER* chara_state3(CHARACTER *p) { p->task = STATE3; - return putTamaTask1(p); + return sendContainerTask(p); } + CHARACTER* chara_state4(CHARACTER *p) { @@ -265,6 +454,7 @@ return withJikiTask(p); } + CHARACTER* chara_state5(CHARACTER *p) { @@ -272,6 +462,7 @@ return withJikiTask(p); } + CHARACTER* chara_state6(CHARACTER *p) { @@ -279,277 +470,81 @@ return withJikiTask(p); } + CHARACTER* chara_state7(CHARACTER *p) { p->task = STATE7; - return putTamaTask1(p); -} - -#if 0 -// state1 boss patern -CHARACTER * chara_state8(CHARACTER *p) -{ - if(p->y < 520) - { - tekino0 = p; - kyeenemyno = p; - p->y += p->vy; - count++; - DefSpriteEx(p->charano, 16*4, 32*4); - PutSpriteEx(p->charano, (p->x * 4), (p->y * 4), 0.2, 0.2, 1); - p->dt1 = 512; - p->s = 0.125; - p->state = chara_state8; - return p; - } - p->state = chara_state9; - return p; -} - -CHARACTER * chara_state9(CHARACTER *p) -{ - if(p->s <= 2) - { - p->s += 0.05; - p->y -= 12; - count++; - DefSpriteEx(54, 16*4, 32*4); - PutSpriteEx(54, (p->x * 4), (p->y * 4), p->s, p->s, 1); - p->state = chara_state9; - return p; - } - count++; - DefSpriteEx(54, 16, 32); - PutSpriteEx(54, p->x, p->y, p->s, p->s, 1); - rinkx = p->x; - rinky = p->y; - Putenemy(5, rinkx - 16, rinky - 16, 1, 0, chara_state10); - Putenemy(5, rinkx - 16, rinky - 16, -1, 0, chara_state10); - p->state = chara_state11; - p->dt1 = 8192; - return p; + return sendContainerTask(p); } -CHARACTER * chara_state10(CHARACTER *p) +// state1 boss patern +CHARACTER* +chara_state8(CHARACTER *p) { - if(p->dt1 < 48) - { - p->x += p->vx; - p->y += p->vy; - p->dt1++; - p->state = chara_state10; - //PutSprite(count, p->x, p->y, - return p; - } - rinkf1 = 1; - p->dt1 = rinkx; - p->dt2 = rinky; - p->state = chara_state13; - return p; + tekino0 = p; + kyeenemyno = p; + + p->task = STATE8; + return BossTask1(p); +} + + +CHARACTER* +chara_state9(CHARACTER *p) +{ + p->task = STATE9; + return BossTask2(p); } -CHARACTER * chara_state11(CHARACTER *p) +CHARACTER* +chara_state10(CHARACTER *p) { - if(rinkf1 == 0) - { - count++; - DefSpriteEx(54, 16, 32); - PutSpriteEx(54, p->x, p->y, p->s, p->s, 1); - p->state = chara_state11; - return p; - } - p->dt1 = 0; - p->dt2 = 0; - p->state = chara_state12; - return p; + p->task =STATE10; + return BossTask3(p); } -CHARACTER * chara_state12(CHARACTER *p) + +CHARACTER* +chara_state11(CHARACTER *p) { - 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 p; - } - 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 p; + p->task = STATE11; + return BossTask4(p); } -CHARACTER * chara_state13(CHARACTER *p) +CHARACTER* +chara_state12(CHARACTER *p) { - if(tekino0->f == FALSE){ - Bom(p->x, p->y); - p->f = FALSE; - p->state = delete_chara; - p->collision = noaction; - return p; - } + p->task = STATE12; + return BossTask5(p); +} + - 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 p; +CHARACTER* +chara_state13(CHARACTER *p) +{ + p->task = STATE13; + return BossTask6(p); } -#endif + -CHARACTER * chara_state20(CHARACTER *p) +CHARACTER* +chara_state20(CHARACTER *p) { p->task = STATE20; return SimpleStateTask(p); } -CHARACTER * chara_state21(CHARACTER *p) + +CHARACTER* +chara_state21(CHARACTER *p) { p->task = STATE21; return SimpleStateTask(p); } - - //ここまでgetate boss @@ -565,6 +560,7 @@ return p; } + #if 0 CHARACTER * chara_state24(CHARACTER *p) {