script_enemy_main {

	#include_function ".\boss1anim.txt";
    #include_function ".\..\lib\enemyfunctions.txt"
	#include_function ".\spellcard.txt";
	let frame=0;
	
sub move{
	let x=GetPlayerX+rand(-50, 50);
	while(x<GetClipMinX+20 || x>GetClipMaxX-20){x=GetPlayerX+rand(-50, 50);}
	SetMovePosition02(x, rand(100, 200), rand_int(60, 80));
}

	@Initialize {
		SetInvincibility(200);
		LoadUserShotData(GetCurrentScriptDirectory~"supershot.txt");
		EnemyInit(70, 10);
		Lifebar;
	}
	
	@MainLoop{
		SetCollisionA(GetX, GetY, 12);
		SetCollisionB(GetX, GetY, 12);
		frame++;
		if(frame%100==0){
			ascent(i in -5..6){
				ascent(j in 0..4){
					CreateShot01(GetX, GetY, 1+absolute(3*sin(i*5)), i*180/11+j*90, 16, 10);
				}
			}
			move;
		}
        yield;
	}
		
	@DrawLoop {
		anim_idleb;
	}
	
	@Finalize {
	}
}