#東方弾幕風 #Title[M,i弾幕] #Text[テストスクリプト] #ScriptVersion[2] script_enemy_main { let imgBoss = "script\img\ExRumia.png"; let frame = 0; let angleBase = 90; let BossY = GetClipMinY + 120; //ここには敵の登場位置のYを入れてください。 let MoveF = 120; //ここには何フレーム毎に移動するかを入れてください。 function Qif (YesR,NoR,Quest) { //Qif(正解時の返答,不正解時の返答,問題) if (Quest) {return(YesR)}else{return(NoR)} } @Initialize { SetX(GetCenterX); SetY(GetClipMinY + 120); SetLife(2000); SetDamageRate(20,5); LoadGraphic(imgBoss); SetTexture(imgBoss); SetGraphicRect(0, 0, 63, 63); } @MainLoop { SetCollisionA(GetX, GetY, 24); SetCollisionB(GetX, GetY, 24); frame++; let X=rand(32,416); let Y=GetY-rand(20,80); if((frame-60)%MoveF==0&&MoveF!=0){ SetMovePosition02(GetX()+(Qif(Qif(1,-1,GetX<356),Qif(-1,1,GetX>92),GetX<=GetPlayerX))*rand(40,60),rand(BossY-40,BossY+40),60) } if(frame%20==0){ loop(10){ CreateShot01(X,Y,2,angleBase,GREEN12,30); CreateShot01(X+20,Y,2,angleBase,GREEN12,30); X+=1; Y+=4; } Y-=40; X-=10; loop(10){ CreateShot01(X,Y,2,angleBase,GREEN12,30); CreateShot01(X+20,Y,2,angleBase,GREEN12,30); Y+=4; X-=1; } X=rand(32,416); Y=GetY; CreateShot01(X,GetY-20,2,angleBase,RED12,30); loop(8){ CreateShot01(X,Y,2,angleBase,RED12,30); Y+=4; } } } @DrawLoop { DrawGraphic(GetX, GetY); } @Finalize { DeleteGraphic(imgBoss); } }