Mercurial > hg > Members > tkaito > task_dandy
view spe/EnemyMove.cc @ 25:aa37f220b7a8
add new files, not working.
author | koba <koba@cr.ie.u-ryukyu.ac.jp> |
---|---|
date | Wed, 24 Nov 2010 19:24:43 +0900 |
parents | bed43801fd01 |
children |
line wrap: on
line source
#include <stdio.h> #include "SchedTask.h" #include "EnemyMove.h" #include "Func.h" static int move00(SchedTask *s,void *rbuf, void *wbuf) { ObjPropertyPtr obj = (ObjPropertyPtr)s->get_input(rbuf, 0); obj[0].x += obj[0].vx; obj[0].y += obj[0].vy; s->swap(); return 0; } static int move01(SchedTask *s,void *rbuf, void *wbuf) { ObjPropertyPtr obj = (ObjPropertyPtr)s->get_input(rbuf, 0); obj[0].x -= obj[0].vx; obj[0].y -= obj[0].vy; s->swap(); return 0; } static int move02(SchedTask *s,void *rbuf, void *wbuf) { ObjPropertyPtr obj = (ObjPropertyPtr)s->get_input(rbuf, 0); obj[0].vy -= 0.25; obj[0].y += obj[0].vy; s->swap(); return 0; } static int move03(SchedTask *s,void *rbuf, void *wbuf) { ObjPropertyPtr obj = (ObjPropertyPtr)s->get_input(rbuf, 0); obj[0].x += obj[0].vx; obj[0].y += obj[0].vy; /* if((obj[0].dt1 == 60) || (obj[0].dt1 == 90) || (obj[0].dt1 == 30)) { Puttama(0, obj[0].x, obj[0].y); } obj.dt++; */ s->swap(); return 0; } static int move04(SchedTask *s,void *rbuf, void *wbuf) { ObjPropertyPtr obj = (ObjPropertyPtr)s->get_input(rbuf, 0); obj[0].x += obj[0].vx; obj[0].y += obj[0].vy; /* if(obj[0].y < jiki.y && obj[0].y + 16 > jiki.y) { obj[0].vy = -2; obj[0].vy = ((jiki.x > obj[0].x) ? 4 : -4); move07(s, rbuf, wbuf); } */ s->swap(); return 0; } static int move05(SchedTask *s,void *rbuf, void *wbuf) { ObjPropertyPtr obj = (ObjPropertyPtr)s->get_input(rbuf, 0); obj[0].x += obj[0].vx; obj[0].y += obj[0].vy; /* if(obj[0].y + 96 < jiki.y && obj[0].y + 128 > jiki.y) { obj[0].vy = -2; obj[0].vx = ((jiki.x > obj[0].x) ? 4 : -4); move00(s, rbuf, wbuf); } */ s->swap(); return 0; } static int move06(SchedTask *s,void *rbuf, void *wbuf) { ObjPropertyPtr obj = (ObjPropertyPtr)s->get_input(rbuf, 0); obj[0].x += obj[0].vx; obj[0].y += obj[0].vy; /* if(obj[0].y + 96 < jiki.y && obj[0].y + 128 > jiki.y) { obj[0].vy = 2; obj[0].vx = ((jiki.x > obj[0].x) ? 4 : -4); move00(s, rbuf, wbuf); } */ s->swap(); return 0; } static int move07(SchedTask *s,void *rbuf, void *wbuf) { ObjPropertyPtr obj = (ObjPropertyPtr)s->get_input(rbuf, 0); obj[0].x += obj[0].vx; obj[0].y += obj[0].vy; /* if((obj[0].dt == 60) || (obj[0].dt == 90) || (obj[0].dt1 == 30)) { Puttama(1, obj[0].x, obj[0].y); } obj[0].dt++; */ s->swap(); return 0; } static int move08(SchedTask *s,void *rbuf, void *wbuf) { //ObjPropertyPtr obj = (ObjPropertyPtr)s->get_input(rbuf, 0); /* if(obj[0].y < 520) { tekino0 = obj[0]; obj[0].y += obj.vy; count++; DefSpriteEx(obj.charano, 16*4, 32*4); PutSpriteEx(obj.charano, (obj[0].x * 4), (obj[0].y * 4), 0.2, 0.2, 1); obj[0].dt1 = 512; obj[0].s = 0.125; s->swap(); return 0; } move09(s, rbuf, wbuf); */ s->swap(); return 0; } static int move09(SchedTask *s,void *rbuf, void *wbuf) { //ObjPropertyPtr obj = (ObjPropertyPtr)s->get_input(rbuf, 0); /* if(obj[0].s <= 2) { obj[0].s += 0.05; obj[0].y -= 12; count++; DefSpriteEx(54, 16*4, 32*4); PutSpriteEx(54, (obj[0].x * 4), (obj[0].y * 4), obj[0].s, obj[0].s, 1); s->swap(); return 0; } count++; DefSpriteEx(54, 16, 32); PutSpriteEx(54, obj[0].x, obj[0].y, obj[0].s, obj[0].s, 1); rinkx = obj[0].x; rinky = obj[0].y; Putenemy(5, rinkx - 16, rinky - 16, 1, 0, Move10); Putenemy(5, rinkx - 16, rinky - 16, -1, 0, Move10); move11(s, rbuf, wbuf); obj[0].dt1 = 8192; */ s->swap(); return 0; } static int move10(SchedTask *s,void *rbuf, void *wbuf) { //ObjPropertyPtr obj = (ObjPropertyPtr)s->get_input(rbuf, 0); /* if(obj[0].dt1 < 48) { obj[0].x += obj[0].vx; obj[0].y += obj[0].vy; obj[0].dt1++; s->swap(); return 0; } rinkf1 = 1; obj[0].dt1 = rinkx; obj[0].dt2 = rinky; move13(s, rbuf, wbuf); */ s->swap(); return 0; } static int move11(SchedTask *s,void *rbuf, void *wbuf) { //ObjPropertyPtr obj = (ObjPropertyPtr)s->get_input(rbuf, 0); /* if(rinkf1 == 0) { count++; DefSpriteEx(54, 16, 32); PutSpriteEx(54, obj[0].x, obj[0].y, obj[0].s, obj[0].s, 1); s->swap(); return 0; } obj[0].dt1 = 0; obj[0].dt2 = 0; move12(s, rbuf, wbuf); */ s->swap(); return 0; } static int move12(SchedTask *s,void *rbuf, void *wbuf) { //ObjPropertyPtr obj = (ObjPropertyPtr)s->get_input(rbuf, 0); /* if(fastebos > 60*60) { if(obj[0].y > 240+32) { obj[0].state = delete_chara; } obj[0].y += 3; rinky += 3; count++; DefSpriteEx(54, 16, 32); PutSpriteEx(54, obj.x, obj.y, 2, 2, 1); s->swap(); return p; } if(obj[0].dt1 <= 60) { if(jiki.x + 15 - rinkx < -5) { obj[0].vx = -0.8; } else if(jiki.x + 15 - rinkx > 5) { obj[0].vx = +0.8; } else obj[0].vx = 0; rinkx = obj[0].x; rinky = obj[0].y; } if((obj[0].dt1 > 60) && (obj[0].dt1 <= 70)) { if(obj[0].dt1 % 2 == 1) { Puttama(0, rinkx - 16, rinky); Puttama(0, rinkx, rinky); Puttama(0, rinkx + 16, rinky); } } if((obj[0].dt1 > 180) && (obj[0].dt1 <= 240)) { if(obj[0].dt1 % 2 == 1) { rinkf2 = 1; Puttama(2, rinkx - 16, obj[0].y - 32); Puttama(3, rinkx + 32 - 16, obj[0].y - 32); } else { rinkf2 = 2; } } if(obj[0].dt1 > 240) { rinkf2 = 2; } if((obj[0].dt1 > 240) && (obj[0].dt1 <= 400)) { count++; PutSprite(count, rinkx - 16, rinky + 32, 58 + obj[0].dt1 % 4); } if((obj[0].dt1 > 300) && (obj[0].dt1 <= 400)) { rinkf2 = 3; if(jiki.x + 15 - rinkx < -5) { obj[0].vx = -1; } else if(jiki.x + 15 - rinkx > 5) { obj[0].vx = +1; } else obj[0].vx = 0; obj[0].x += obj[0].vx; rinkx = obj[0].x; rinky = obj[0].y; Puttama(4, rinkx - 8, rinky + 16); } if((obj[0].dt1 > 400) && (obj[0].dt1 <= 500)) { rinkf2 = 4; if(jiki.x + 15 - rinkx > 5) { obj[0].vx = -1; } else if(jiki.x + 15 - rinkx > 5) { obj[0].vx = +1; } else obj[0].vx = 0; obj[0].x += obj[0].vx; rinkx = obj[0].x; rinky = obj[0].y; } if(obj[0].dt1 > 500) { rinkf2 = 5; if(jiki.x + 15 - rinkx < -5) { obj[0].vx = -1; } else if(jiki.x + 15 - rinkx > 5) { obj[0].vx = +1; } else obj[0].vx = 0; obj[0].x += obj[0].vx; rinkx = obj[0].x; rinky = obj[0].y; } if(obj[0].dt1 > 600) { rinkf2 = 0; obj[0].dt1 = 0; } fastebos++; obj[0].dt1++; count++; DefSpriteEx(54, 16, 32); PutSpriteEx(54, obj[0].x, obj[0].y, 2, 2, 1); */ s->swap(); return 0; } static int move13(SchedTask *s,void *rbuf, void *wbuf) { //ObjPropertyPtr obj = (ObjPropertyPtr)s->get_input(rbuf, 0); /* if(tekino0.f == FALSE){ Bom(obj[0].x, obj[0].y); obj[0].f = FALSE; obj[0].state = delete_chara; obj[0].collision = noaction; s->swap(); return 0; } obj[0].x += rinkx - obj[0].dt1; obj[0].y += rinky - obj[0].dt2; obj[0].dt1 = rinkx; obj[0].dt2 = rinky; if(rinkf2 == 1) { if(obj[0].x > rinkx) { Puttama(2, obj[0].x + 32, obj[0].y); } if(obj[0].x < rinkx) { Puttama(3, obj[0].x, obj[0].y); } } if(rinkf2 == 4) { count++; PutSprite(count, obj[0].x, obj[0].y + 56, 58+filpcount % 4); } if(rinkf2 == 5) { if(obj[0].x > rinkx) { Puttama(5, obj[0].x + 8, obj[0].y + 24); } if(obj[0].x < rinkx) { Puttama(5, obj[0].x + 8, obj[0].y + 24); } } */ s->swap(); return 0; } static int move20(SchedTask *s,void *rbuf, void *wbuf) { ObjPropertyPtr obj = (ObjPropertyPtr)s->get_input(rbuf, 0); obj[0].x += obj[0].vx; obj[0].y += obj[0].vy; obj[0].vy -= 0.5; obj[0].vy += 0.4; s->swap(); return 0; } static int move21(SchedTask *s,void *rbuf, void *wbuf) { ObjPropertyPtr obj = (ObjPropertyPtr)s->get_input(rbuf, 0); obj[0].x += obj[0].vx; obj[0].y += obj[0].vy; obj[0].vy += 0.5; obj[0].vy += 0.4; s->swap(); return 0; } static int move22(SchedTask *s,void *rbuf, void *wbuf) { //ObjPropertyPtr obj = (ObjPropertyPtr)s->get_input(rbuf, 0); /* sf = rand() % 4; if((sf == 0) || (sf == 1)) { obj[0].x = -35; obj[0].y = rand() % (120 - 35); obj[0].vx = (rand() % 4 + 1); obj[0].vy = rand() % 3 + 1; move23(s, rbuf, wbuf); s->swap(); return 0; } if((sf == 2)) { obj[0].x = rand() % 290; obj[0].y = -30; obj[0].vx = rand() % 3 - 1; obj[0].vy = (rand() % 4 + 1); move23(s, rbuf, wbuf); s->swap(); return 0; } if(sf == 3) { obj[0].x = 320; obj[0].y = rand() % (120 - 35); obj[0].vx = (rand() % 4 + 1) * -1; obj[0].vy = rand() % 3 -1; move23(s, rbuf, wbuf); s->swap(); return 0; } */ s->swap(); return 0; } static int move23(SchedTask *s,void *rbuf, void *wbuf) { //ObjPropertyPtr obj = (ObjPropertyPtr)s->get_input(rbuf, 0); //asteroid(s, rbuf, wbuf); s->swap(); return 0; } static int move24(SchedTask *s,void *rbuf, void *wbuf) { //ObjPropertyPtr obj = (ObjPropertyPtr)s->get_input(rbuf, 0); /* kyeenemyno = obj[0]; tekino0 = 0; enemy_part1 = obj[0].next; enemy_part2 = enemy_part1->next; enemy_part3 = enemy_part2->next; enemy_part4 = enemy_part3->next; enemy_part5 = enemy_part4->next; rinkx = 0; rinky = 0; rinkf1 = 0; rinkf2 = 0; move25(s, rbuf, wbuf); */ s->swap(); return 0; } static int move25(SchedTask *s,void *rbuf, void *wbuf) { //ObjPropertyPtr obj = (ObjPropertyPtr)s->get_input(rbuf, 0); /* if(obj[0].dt1 <= 360) { obj[0].x = Mycos(obj[0].dt1) * 30 / SANKAKU + 82 + 32; obj[0].y = Mysin(obj[0].dt1) * 30 / SANKAKU + 30; } if(obj[0].dt1 > 360) { obj[0].x = Mycos(obj[0].dt1) * 30 * -1 /SANKAKU + 142 + 32; obj[0].y = Mysin(obj[0].dt1) * 30 / SANKAKU + 30; } count++; PutSprite(count, obj[0].x - 42, obj[0].y, 64); amari = rand() % 160; if((amari == 1) && (enemy_part5->f == TRUE)) { rinkf1 = 1; move26(s, rbuf, wbuf); return 0; } if((amari == 2) && (enemy_part1->f == TRUE)) { rinkf1 = 5; rinkx = 0; move27(s, rbuf, wbuf); //s->swap(); return 0; } if((enemy_part5->f == TRUE) && (enemy_part1->f != TRUE)) { move28(s, rbuf, wbuf); //s->swap(); return 0; } obj[0].dt1 += 3; if(obj[0].dt1 == 720) { obj[0].dt1 = 0; } */ s->swap(); return 0; } static int move26(SchedTask *s,void *rbuf, void *wbuf) { //ObjPropertyPtr obj = (ObjPropertyPtr)s->get_input(rbuf, 0); /* if((obj[0].dt2 > 50) && (obj[0].dt2 < 100)) { rinkf1 = 2; } if(obj[0].dt2 > 100) { rinkf1 = 3; } if(obj[0].dt2 == 400) { rinkf1 = 4; } count++; PutSprite(count, obj[0].x - 42, obj[0].y, 64); if(obj[0].dt2 == 401) { obj[0].dt2 = 0; rinkf1 = 0; move25(s, rbuf, wbuf); return 0; } obj[0].dt2++; */ s->swap(); return 0; } static int move27(SchedTask *s,void *rbuf, void *wbuf) { //ObjPropertyPtr obj = (ObjPropertyPtr)s->get_input(rbuf, 0); /* if((obj[0].dt2 > 50) && (obj[0].dt2 < 60) && (obj[0].x > -24) && (obj[0].y > -24)) { rinkf1 = 6; rinkx -= 4; obj[0].x -= 4; obj[0].y -= 4; } if(obj[0].dt2 == 80) { rinkf1 = 7; } if(obj[0].dt2 == 81) { rinkf1 = 8; } if(obj[0].dt2 == 124) { rinkf1 = 9; } if(obj[0].dt2 == 400) { rinkf1 = 10; } if(obj[0].dt2 == 444) { rinkf1 = 11; } if(obj[0].dt2 == 500) { rinkf1 = 12; } if((obj[0].dt2 > 80) && (obj[0].dt2 < 200)) { if((rinkx != 0) && (obj[0].dt2 % 2 == 1)) { rinkx++; obj[0].x++; obj[0].y++; } } count++; PutSprite(count, obj[0].x - 32, obj[0].y, 6); if(rinkf1 == 12) { obj[0].dt2 = 0; rinkf1 = 0; rinkx = 0; move25(s, rbuf, wbuf); return 0; } obj[0].dt2++; */ s->swap(); return 0; } static int move28(SchedTask *s,void *rbuf, void *wbuf) { //ObjPropertyPtr obj = (ObjPropertyPtr)s->get_input(rbuf, 0); /* if (obj[0].dt1 <= 360) { obj[0].x = Mycos(obj[0].dt1) * 30 / SANKAKU + 82 + 32; obj[0].y = Mysin(obj[0].dt1) * 30 / SANKAKU + 30; } if (obj[0].dt1 > 360) { obj[0].x = Mycos(obj[0].dt1) * 30 * -1 / SANKAKU + 142 + 32; obj[0].y = Mysin(obj[0].dt1) * 30 / SANKAKU + 30; } count++; PutSprite(count, obj[0].x - 42, obj[0].y, 64); if (obj[0].dt1 % 30 == 3) { Putenemy(24, obj[0].x + 14, obj[0].y + 14, (rand() % 5 + 0.5) * (rand() % 2 == 1 ? -1 : 1), (rand() % 5 + 0.5) * (rand() % 2 == 1 ? -1 : 1), chara_state29); } obj[0].dt1 += 3; */ s->swap(); return 0; } static int move29(SchedTask *s,void *rbuf, void *wbuf) { ObjPropertyPtr obj = (ObjPropertyPtr)s->get_input(rbuf, 0); obj[0].x += obj[0].vx; obj[0].y += obj[0].vy; /* if(obj[0].dt1 % 18 == 1) { Puttama(0, obj[0].x, obj[0].y); } obj[0].dt1++; */ s->swap(); return 0; } static int move30(SchedTask *s,void *rbuf, void *wbuf) { ObjPropertyPtr obj = (ObjPropertyPtr)s->get_input(rbuf, 0); obj[0].x -= 32; obj[0].y = obj[0].y; s->swap(); return 0; } static int move31(SchedTask *s,void *rbuf, void *wbuf) { //ObjPropertyPtr obj = (ObjPropertyPtr)s->get_input(rbuf, 0); /* if((enemy_part3->f == FALSE) || (kyeenemyno->f == FALSE)) { Bom(obj[0].x, obj[0].y); obj[0].f = FALSE; obj[0].state = delete_chara; obj[0].collision = noaction; return 0; } if(rinkf1 == 0) { obj[0].x = kyeenemyno->x + 40; obj[0].y = kyeenemyno->y + 28; obj[0].dt2 = 0; } if(rinkf1 == 5) { obj[0].x = kyeenemyno->x + 52; obj[0].y = kyeenemyno->y; count++; PutSprite(count, obj[0].x - 4, obj[0].y - 20, 80 + obj[0].dt2 % 4); obj[0].dt2++; } if(rinkf1 == 6) { if(obj[0].y < 240 - 40) { obj[0].y += 6; } else { return 0; } count++; PutSprite(count, obj[0].x - 4, obj[0].y - 20, 90 + obj[0].dt2 % 4); obj[0].dt2++; } if(rinkf1 == 7) { Putenemy(22, obj[0].x + 14, obj[0].y + 14, 0, 0, chara_state40); return 0; } if(rinkf1 == 11) { if(obj[0].y + 20 != obj[0].y) { obj[0].y--; } else { return 0; } count++; PutSprite(count, obj[0].x + 8, obj[0].y + 44, 58 + obj[0].dt2 % 4); obj[0].dt2++; } */ s->swap(); return 0; } static int move32(SchedTask *s,void *rbuf, void *wbuf) { //ObjPropertyPtr obj = (ObjPropertyPtr)s->get_input(rbuf, 0); /* if ((enemy_part4->f == FALSE) || (kyeenemyno->f == FALSE)) { Bom(obj[0].x, obj[0].y); obj[0].f = FALSE; obj[0].state = delete_chara; obj[0].collision = noaction; return 0; } obj[0].x = kyeenemyno->x - 40; obj[0].y = kyeenemyno->y + 28; if (rinkf1 == 5) { obj[0].x = kyeenemyno->x - 24 + 4; obj[0].y = kyeenemyno->y + 28; obj[0].charano = enemystate[20].charano; // これまずいね } if (rinkf1 == 11) { obj[0].charano = enemystate[14].charano; // これまずいね } if (rinkf1 == 7) { Putenemy(23, obj[0].x + 14, obj[0].y + 14, 0, 0, chara_state41); // rinkf1=8; return 0; } */ s->swap(); return 0; } static int move33(SchedTask *s,void *rbuf, void *wbuf) { //ObjPropertyPtr obj = (ObjPropertyPtr)s->get_input(rbuf, 0); /* if (kyeenemyno->f == FALSE) { Bom(obj[0].x, obj[0].y); obj[0].f = FALSE; obj[0].state = delete_chara; obj[0].collision = noaction; return p; } obj[0].x = kyeenemyno->x + 32; obj[0].y = kyeenemyno->y; if (rinkf1 == 5) { obj[0].x = kyeenemyno->x + 32 - 4; obj[0].y = kyeenemyno->y; obj[0].charano = enemystate[19].charano; // ここまずいね } if (rinkf1 == 6) { obj[0].charano = enemystate[11].charano; // ここマズイね } */ s->swap(); return 0; } static int move34(SchedTask *s,void *rbuf, void *wbuf) { //ObjPropertyPtr obj = (ObjPropertyPtr)s->get_input(rbuf, 0); /* if (kyeenemyno->f == FALSE) { Bom(obj[0].x, obj[0].y); obj[0].f = FALSE; obj[0].state = delete_chara; obj[0].collision = noaction; return p; } obj[0].x = kyeenemyno->x - 32; obj[0].y = kyeenemyno->y; if (rinkf1 == 5) { obj[0].charano = enemystate[21].charano; } if (rinkf1 == 6) { obj[0].charano = enemystate[12].charano; } */ s->swap(); return 0; } static int move35(SchedTask *s,void *rbuf, void *wbuf) { //ObjPropertyPtr obj = (ObjPropertyPtr)s->get_input(rbuf, 0); /* if (kyeenemyno->f == FALSE) { Bom(obj[0].x, obj[0].y); obj[0].f = FALSE; obj[0].state = delete_chara; obj[0].collision = noaction; return p; } obj[0].x = kyeenemyno->x; obj[0].y = kyeenemyno->y + 32; if (rinkf1 == 1) { obj[0].charano = enemystate[16].charano; } if (rinkf1 == 2) { count++; PutSprite(count, obj[0].x - 10, obj[0].y + 16, 58 + obj[0].dt2 % 4); count++; PutSprite(count, obj[0].x + 10, obj[0].y + 16, 58 + obj[0].dt2 % 4); obj[0].dt2++; } if (rinkf1 == 3) { count++; PutSprite(count, obj[0].x - 10, obj[0].y + 16, 58 + obj[0].dt2 % 4); count++; PutSprite(count, obj[0].x + 10, obj[0].y + 16, 58 + obj[0].dt2 % 4); if (obj[0].dt2 % 20 == 1) { Puttama(7, obj[0].x, obj[0].y + 16); Puttama(7, obj[0].x + 20, obj[0].y + 16); } obj[0].dt2++; } if (rinkf1 == 4) { obj[0].charano = enemystate[15].charano; obj[0].dt2 = 0; } */ s->swap(); return 0; } static int move40(SchedTask *s,void *rbuf, void *wbuf) { //ObjPropertyPtr obj = (ObjPropertyPtr)s->get_input(rbuf, 0); /* if (enemy_part1->f == FALSE) { Bom(obj[0].x, obj[0].y); obj[0].f = FALSE; obj[0].state = delete_chara; obj[0].collision = noaction; return 0; } if ((rinkf1 == 8) && (obj[0].dt1 % 3 == 1)) { if ((obj[0].dt2 < 16)) { obj[0].dt2++; DefSprite(76, "boss2_rightarm_b", 16, obj[0].dt2, 480, boss); } else { // rinkf1=9; return 0; } } if (rinkf1 == 9) { if (obj[0].dt1 % 15 == 1) { Puttama(8, obj[0].x, obj[0].y); } } if (rinkf1 == 10) { if (obj[0].dt2 != 0) { obj[0].dt2--; DefSprite(76, "boss2_rightarm_b", 16, obj[0].dt2, 480, boss); } else { obj[0].f = FALSE; obj[0].state = delete_chara; obj[0].collision = noaction; // rinkf1=11; } } obj[0].dt1++; */ s->swap(); return 0; } static int move41(SchedTask *s,void *rbuf, void *wbuf) { //ObjPropertyPtr obj = (ObjPropertyPtr)s->get_input(rbuf, 0); /* if (enemy_part2->f == FALSE) { Bom(obj[0].x, obj[0].y); obj[0].f = FALSE; obj[0].state = delete_chara; obj[0].collision = noaction; return 0; } obj[0].x = kyeenemyno->x - 20 - 7; obj[0].y = kyeenemyno->y + 28 + 15; if ((rinkf1 == 8) && (obj[0].dt1 % 3 == 1)) { if ((obj[0].dt2 < 16)) { obj[0].dt2++; DefSprite(77, "boss2_leftarmbattery", obj[0].dt2, 16, 480, boss); //左腕アップアーム砲 } else { rinkf1 = 9; return 0; } } if (rinkf1 == 9) { if (obj[0].dt1 % 15 == 1) { Puttama(9 + rand() % 2, obj[0].x, obj[0].y); } } if (rinkf1 == 10) { if (obj[0].dt2 != 0) { obj[0].dt2--; DefSprite(77, "boss2_leftarmbattery", obj[0].dt2, 16, 480, boss); } else { obj[0].f = FALSE; obj[0].state = delete_chara; obj[0].collision = noaction; return 0; // rinkf1=11; } } obj[0].dt1++; */ s->swap(); return 0; } static int move400(SchedTask *s,void *rbuf, void *wbuf) { ObjPropertyPtr obj = (ObjPropertyPtr)s->get_input(rbuf, 0); obj[0].vy++; obj[0].y += obj[0].vy / 4; s->swap(); return 0; } static int move401(SchedTask *s,void *rbuf, void *wbuf) { //ObjPropertyPtr obj = (ObjPropertyPtr)s->get_input(rbuf, 0); /* obj[0].vx++; obj[0].x += obj[0].vx / 8; if (obj[0].x > (jiki.x - 32)) { obj[0].vy--; } obj[0].y += obj[0].vy / 8; if (obj[0].dt1 % 50 == 37) { Puttama(1, obj[0].x + 8, obj[0].y + 24); } obj[0].dt1++; */ s->swap(); return 0; } static int move402(SchedTask *s,void *rbuf, void *wbuf) { //ObjPropertyPtr obj = (ObjPropertyPtr)s->get_input(rbuf, 0); /* obj[0].vx--; obj[0].x += obj[0].vx / 8; if (obj[0].x < (jiki.x + 32)) { obj[0].vy--; } obj[0].y += obj[0].vy / 8; if (obj[0].dt1 % 50 == 37) { Puttama(1, obj[0].x + 8, obj[0].y + 24); } obj[0].dt1++; */ s->swap(); return 0; } static int move410(SchedTask *s,void *rbuf, void *wbuf) { //ObjPropertyPtr obj = (ObjPropertyPtr)s->get_input(rbuf, 0); //kyeenemyno = obj[0]; s->swap(); return 0; } static int move411(SchedTask *s,void *rbuf, void *wbuf) { //ObjPropertyPtr obj = (ObjPropertyPtr)s->get_input(rbuf, 0); /* if (obj[0].dt2 > 356) { obj[0].vx = -1; } if (obj[0].dt2 < -398) { obj[0].vx = 1; } if ((obj[0].dt1) % 62 == 0) Putenemy(41, obj[0].x, obj[0].y, (int) -Mycos(obj[0].dt1 / 16) * 4 / SANKAKU, (int) -Mysin(obj[0].dt1 / 16) * 4 / SANKAKU, Move07); if ((obj[0].dt1) % 13 == 0) Puttama(11, obj[0].x + 32, obj[0].y + 32); obj[0].dt2 += obj[0].vx; obj[0].dt1 += obj[0].dt2 / 4; obj[0].x = jiki.x - 16 + Mycos(obj[0].dt1 / 16) * 128 / SANKAKU; obj[0].y = jiki.y - 16 + Mysin(obj[0].dt1 / 16) * 128 / SANKAKU; if (obj[0].x < 0) { obj[0].x = 0; } if (obj[0].x > 260) { obj[0].x = 260; } if (obj[0].y < 0) { obj[0].y = 0; } if (obj[0].y > 232) { obj[0].y = 232; } */ s->swap(); return 0; } static int move500(SchedTask *s,void *rbuf, void *wbuf) { //ObjPropertyPtr obj = (ObjPropertyPtr)s->get_input(rbuf, 0); //obj[0].s = 0; /* kyeenemyno = obj[0]; obj[0].dt2++; obj[0].dt2 %= 512; obj[0].dt1++; count++; DefSpriteEx(100, 16, 16); // PutSprite(count, enemy[tekino].x + 16, // enemy[tekino].y + 16, 100); PutSpriteEx(100, obj[0].x + 16, obj[0].y + 16, 2, 2, obj[0].dt1); if (obj[0].dt1 % (5 + obj[0].dt2 / 8) == 1) { if (rand() % 2 == 1) Putenemy(24, obj[0].x, obj[0].y, (rand() % 5 + 0.5) * (rand() % 2 == 1 ? -1 : 1), (rand() % 5 + 0.5) * (rand() % 2 == 1 ? -1 : 1), Move501); else Putenemy(rand() % 2 + 1, obj[0].x, obj[0].y, (int) Mycos(obj[0].dt1 / 4) * 4 / SANKAKU, (int) -Mysin(obj[0].dt1 / 4) * 4 / SANKAKU, Move501); } if (obj[0].dt1 == 50) { //Putenemy(44,0,0,1,1,411); } */ s->swap(); return 0; } static int move501(SchedTask *s,void *rbuf, void *wbuf) { ObjPropertyPtr obj = (ObjPropertyPtr)s->get_input(rbuf, 0); obj[0].x += obj[0].vx; obj[0].y += obj[0].vy; /* if(obj[0].dt1 % 32 == 1) { Puttama(11, obj[0].x, obj[0].y); } obj[0].dt1++; */ s->swap(); return 0; } static int move600(SchedTask *s,void *rbuf, void *wbuf) { //ObjPropertyPtr obj = (ObjPropertyPtr)s->get_input(rbuf, 0); /* kyeenemyno = obj[0]; obj[0].dt1 += 30; obj[0].dt2++; obj[0].dt1 %= 360; obj[0].x += Mycos(obj[0].dt1) * 4 / SANKAKU; obj[0].y += Mysin(obj[0].dt1) * 4 / SANKAKU; Puttama(11, obj[0].x + 16, obj[0].y + 16); Puttama(11, obj[0].x + 32, obj[0].y + 48); Puttama(11, obj[0].x + 48, obj[0].y + 16); if (obj[0].dt2 > 240) move601(s, rbuf, wbuf); return 0; if (obj[0].x < 0) obj[0].x = 0; if (obj[0].x > 260) obj[0].x = 260; if (obj[0].y < 0) obj[0].y = 0; if (obj[0].y > 232) obj[0].y = 232; */ s->swap(); return 0; } static int move601(SchedTask *s,void *rbuf, void *wbuf) { //ObjPropertyPtr obj = (ObjPropertyPtr)s->get_input(rbuf, 0); /* obj[0].dt2++; if (obj[0].x < jiki.x) obj[0].vx++; if (obj[0].x > jiki.x) obj[0].vx--; obj[0].x += obj[0].vx; Putenemy(6, obj[0].x + 16 + rand() % 32, obj[0].y, 0, rand() % 4, Move400); if (obj[0].x < 0) obj[0].x = 0; if (obj[0].x > 260) obj[0].x = 260; if (obj[0].y < 0) obj[0].y = 0; if (obj[0].y > 232) obj[0].y = 232; if (obj[0].dt2 > 800) { move602(s, rbuf, wbuf); return 0; } */ s->swap(); return 0; } static int move602(SchedTask *s,void *rbuf, void *wbuf) { //ObjPropertyPtr obj = (ObjPropertyPtr)s->get_input(rbuf, 0); /* obj[0].dt2++; Putenemy(24, obj[0].x + 14, obj[0].y + 14, (rand() % 5 + 0.5) * (rand() % 2 == 1 ? -1 : 1), (rand() % 5 + 0.5) * (rand() % 2 == 1 ? -1 : 1), Move29); if (obj[0].dt2 > 1024) { move600(s, rbuf, wbuf); obj[0].dt2 = 0; } */ s->swap(); return 0; } static int asteroid(SchedTask *s,void *rbuf, void *wbuf) { //ObjPropertyPtr obj = (ObjPropertyPtr)s->get_input(rbuf, 0); /* int i; asteroiddt[asteroidi] = obj[0]; // if(asteroidi==0) // { obj[0].x += obj[0].vx; obj[0].y += obj[0].vy; // } if (asteroidi > 0) { for (i = 0; i < asteroidi; i++) { if ((asteroiddt[i]->x + 32 > obj[0].x) && (obj[0].x + 32 > asteroiddt[i]->x) && (asteroiddt[i]->y + 32 > obj[0].y) && (asteroiddt[i]->y < obj[0].y + 32)) { obj[0].vx *= -1; obj[0].vy *= -1; } } } asteroidi++; */ s->swap(); return 0; }