#東方弾幕風 #Title[テストスクリプト] #Text[テストスクリプト] #ScriptVersion[2] #BackGround[] script_enemy_main { let imgBoss = "script\img\ExRumia.png"; @Initialize { SetX(GetCenterX); SetY(GetClipMinY+120); SetLife(500); //SetTimer(120); SetDamageRate(10,0); SetInvincibility(180); LoadGraphic(imgBoss); SetTexture(imgBoss); SetGraphicRect(0, 0, 63, 63); Tmain; } @MainLoop { SetCollisionA(GetX, GetY, 24); SetCollisionB(GetX, GetY, 24); yield; } @DrawLoop { DrawGraphic(GetX, GetY); } @Finalize { DeleteGraphic(imgBoss); } task Tmain{ loop{ let d = 4; let w = 0; let way = 60; let angle = rand(0,180/way); loop(way){ Spilal_Shot(GetX, GetY, angle, 1, RED01, d,w,way); angle +=360/way; w ++; } loop(270){ yield; } let angle = rand(180,180+180/way); let d = 4; let w = 0; loop(way){ Spilal_Shot(GetX, GetY, angle, 1, RED01, d,w,way); angle -=360/way; w ++; } loop(270){ yield; } } } //小弾 task Spilal_Shot(x,y,angle,spd,color,d,w,way){ //オブジェクト弾の作成 let obj = Obj_Create(OBJ_SHOT); //パラメータの設定 Obj_SetPosition(obj, x, y); Obj_SetAngle(obj, angle); Obj_SetSpeed(obj, spd); ObjShot_SetGraphic(obj, color); ObjShot_SetDelay(obj, 10); Obj_SetAutoDelete(obj,true); ObjShot_SetBombResist(obj,true); loop(10){ yield; } let l=0-d*w; let ld= way*d; while(!Obj_BeDeleted(obj)) {//軌道の変化はここに記述 let angle_x = Obj_GetAngle(obj); loop{ if(l>=0 && l%ld==0){ loop(8){ CreateShot01(Obj_GetX(obj), Obj_GetY(obj), 1, angle_x, RED12, 30); angle_x +=360/8; } angle_x +=360/8/3; } if(Obj_BeDeleted(obj)) { break;} l ++; yield; } yield; } yield; } }