Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include"script/default_system/Default_ShotConst.txt"
- #include"script/default_system/Default_Effect.txt"
- @Initialize{
- Enemy(40,100,100);
- Enemy(100,100,100);
- Enemy(160,100,100);
- Enemy(220,100,100);
- Enemy(280,100,100);
- TEnd;
- }
- @MainLoop{
- yield;
- }
- @Event{}
- function Enemy(x,y,life){
- let obj = ObjEnemy_Create(OBJ_ENEMY);
- ObjEnemy_Regist(obj);
- ObjEnemy_SetLife(obj, life);
- ObjMove_SetPosition(obj, x, y);
- ObjPrim_SetTexture(obj, GetCurrentScriptDirectory~"ExRumia.png");
- ObjSprite2D_SetSourceRect(obj, 64, 1, 127, 64);
- ObjSprite2D_SetDestCenter(obj);
- FairyShot(obj);
- FairyMaintenance(obj);
- return obj;
- }
- task FairyMaintenance(fairy){
- while(!Obj_IsDeleted(fairy) && ObjEnemy_GetInfo(fairy, INFO_LIFE) > 0){
- let ex = ObjMove_GetX(fairy);
- let ey = ObjMove_GetY(fairy);
- ObjEnemy_SetIntersectionCircleToShot(fairy, ex, ey, 16);
- ObjEnemy_SetIntersectionCircleToPlayer(fairy, ex, ey, 16);
- yield;
- }
- Obj_Delete(fairy);
- }
- task FairyShot(fairy){
- while(!Obj_IsDeleted(fairy)){
- loop(60){yield;}
- CreateShotA1(ObjMove_GetX(fairy),ObjMove_GetY(fairy),2,90,402,10);
- }
- }
- task TEnd{
- while(length(GetAllEnemyID()) > 0){
- yield;
- }
- loop(30){yield;}
- CloseScript(GetOwnScriptID());
- }
Advertisement
Add Comment
Please, Sign In to add comment