Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- script_enemy_main{
- let D = GetCurrentScriptDirectory;
- let imgFam = D ~ "system\Familiar3.png";
- let s1 = D ~ "sfx\Shot.wav";
- @Initialize{
- SetLife(200);
- LoadGraphic(imgFam);
- LoadSE(s1);
- fire;
- //fireb;
- }
- @MainLoop{
- SetCollisionA(GetX,GetY,16);
- SetCollisionB(GetX,GetY,16);
- yield;
- }
- @DrawLoop{
- SetTexture(imgFam);
- SetRenderState(ALPHA);
- SetAlpha(255);
- SetGraphicRect(0,0,88,90);
- SetGraphicScale(0.5,0.5);
- SetGraphicAngle(0,0,0);
- DrawGraphic(GetX,GetY);
- }
- @Finalize{
- loop(3){CreateItem(ITEM_SCORE,GetX-rand(0,30),GetY-rand(0,30));}
- DeleteSE(s1);}
- task fire{
- loop(5){
- let dir = GetAngleToPlayer;
- loop(32){bullet(GetX,GetY,2,dir,BLUE21,0); dir+=12.25}
- PlaySE(s1);
- wait(60);
- dir=GetAngleToPlayer;
- }
- }
- task fireb{
- let dir = GetAngleToPlayer;
- let thing = 2;
- loop(10){
- loop(6){
- loop(4){CreateShot01(GetX,GetY,thing,dir,BLUE04,0); dir+=90; }
- thing+=0.4;}
- PlaySE(s1);
- wait(20);
- dir+=17;
- thing = 2;
- }
- }
- task bullet(x,y,v,dir,graphic,delay){
- let obj=Obj_Create(OBJ_SHOT);
- Obj_SetPosition(obj,x,y);
- Obj_SetSpeed(obj,v);
- Obj_SetAngle(obj,dir);
- ObjShot_SetGraphic(obj,graphic);
- ObjShot_SetDelay(obj,delay);
- ObjShot_SetBombResist(obj, true);
- while(!Obj_BeDeleted(obj)){
- loop(20){Obj_SetSpeed(obj, Obj_GetSpeed(obj) - 0.1); wait(3);}
- wait(20);
- Obj_SetAngle(obj,atan2(Obj_GetY(obj) - GetPlayerY, Obj_GetX(obj) - GetPlayerX));
- Obj_SetSpeed(obj,3);
- wait(9999999);
- }}
- function wait(w){loop(w){yield;}}
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement