#東方弾幕風 #Title[弾幕制作テスト] #Text[] #Image[] #BackGround[Default] #ScriptVersion[2] script_enemy_main { let count;//弾を出す間隔を制御するための変数; let count2; let cx;//変数cxに真ん中の座標を代入; @Initialize { count=-100;//弾を出す間隔を制御するための変数; count2=-100; cx=GetCenterX();//変数cxに真ん中の座標を代入; SetLife(100);//敵のライフを1000に SetDamageRate(10,0); SetGraphicRect(64,1,127,64);//描画元の矩形を(64,1)-(127,64)に設定 LoadGraphic("script\ExRumia\img\ExRumia.png");//script\img\ExRumia.jpgをテクスチャに読みこみ SetMovePosition02(cx,60,60);//座標(cx,60)に60フレームで移動; WN-wayShot; } @MainLoop { yield; SetCollisionA(GetX(),GetY(),32);//敵の座標に当たり判定を登録 SetCollisionB(GetX(),GetY(),24);//敵の座標に当たり判定(体当たり用)を登録 count++;//1フレーム毎にcountが1増加 } task WN-wayShot { SetShotDirectionType(PLAYER); let count=0; loop{ if(count==60) { let angle=0; let angle_range=180; let way=5; let waving_angle_range=angle_range/(way-1); let speed=5; let angle=GetAngleToPlayer-angle_range/2; while(angle<=180) { CreateShot01(GetX,GetY,speed,angle,BLUE01,0); angle+=180/way; } loop(way) { CreateShot01(GetX,GetY,speed,angle,BLUE01,0); angle+=waving_angle_range; } count=0; } count++; yield; } } @DrawLoop { DrawText("Rumia",50,40,18,255); SetFontColor(255,255,255,128,128,128); SetTexture("script\ExRumia\img\ExRumia.png");//描画元テクスチャを設定 DrawGraphic(GetX(),GetY())//敵の座標にExルーミアを描画; } @Finalize { DeleteGraphic("script\ExRumia\img\ExRumia.png");//読みこんだテクスチャを破棄 loop(365) { CreateShot01(GetX,GetY,rand(7,15),rand(-90,90),WHITE02,0); SetShotColor(128,128,128); } } }