#東方弾幕風 #Title[翡翠「エメラルドライン〜Lunatic」] #Text[線も弾も圧倒的に増えます。反射数アップのおまけ付き] #ScriptVersion[2] script_enemy_main { let img = "script\img\ExRumia.png"; let name = "翡翠「エメラルドスクランブル」"; @Initialize { CutIn(KOUMA, name, "", 0, 0, 0, 0); SetX(GetCenterX); SetY(GetCenterY - 120); SetLife(5000); SetScore(1000000); SetTimer(99); LoadGraphic(img); SetTexture(img); SetGraphicRect(64, 0, 128, 64); TMain; } @MainLoop { SetCollisionA(GetX, GetY, 24); SetCollisionB(GetX, GetY, 24); yield; } @DrawLoop { DrawGraphic(GetX, GetY); } @Finalize { DeleteGraphic(img); } //以下タスク(マイクロスレッド) task TMain { yield; TMove; TShot; TShot2; TShot3;//何個足してもおk } task TMove { yield; } task TShot { yield; SetShotDirectionType(PLAYER); loop { loop(1) { yield; } CreateReflectShot(GetX, GetY, rand(2, 3), rand(0, 360), GREEN01, 0, 3); } } task TShot2 { let angle = 50; yield; loop { loop(2) { CreateReflectShot(GetX, GetY, 5, angle, GREEN23, 0, 2); angle += 360 / 10; } loop(2) { yield; } } } task TShot3 { let angle = 30; yield; loop { loop(2) { CreateReflectShot(GetX, GetY, 5, angle, GREEN23, 0, 2); angle -= 360 / 10; } loop(2) { yield; } } } function wait(w) { loop(w) { yield; } } task CreateReflectShot(x, y, speed, angle, graphic, delay, limit) { //limitは反射回数です let obj = Obj_Create(OBJ_SHOT); Obj_SetPosition(obj, x, y); Obj_SetSpeed(obj, speed); Obj_SetAngle(obj, angle); ObjShot_SetGraphic(obj, graphic); ObjShot_SetDelay(obj, delay); loop(delay) { yield; } while(! Obj_BeDeleted(obj)) { if(Obj_GetX(obj) < GetClipMinX) { Obj_SetX(obj, GetClipMinX * 2 - Obj_GetX(obj)); Obj_SetAngle(obj, 180 - Obj_GetAngle(obj)); limit = 0; } if(Obj_GetX(obj) > GetClipMaxX) { Obj_SetX(obj, GetClipMaxX * 2 - Obj_GetX(obj)); Obj_SetAngle(obj, 180 - Obj_GetAngle(obj)); limit = 1; } if(Obj_GetY(obj) < GetClipMinY){ Obj_SetY(obj, GetClipMinY * 2 - Obj_GetY(obj)); Obj_SetAngle(obj, 360 - Obj_GetAngle(obj)); limit += 1; } if(Obj_GetY(obj) > GetClipMaxY){ Obj_SetY(obj, GetClipMaxY * 2 - Obj_GetY(obj)); Obj_SetAngle(obj, 360 - Obj_GetAngle(obj)); limit += 3; } if(limit <= 0) { break; } yield; } } }