Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include"./lib/lib.txt"
- @Initialize
- {
- InitSub;
- MainTask;
- DrawTask(0);
- FinalTask;
- }
- @Loading
- {
- LoadSound(Shot1);
- }
- @MainLoop
- {
- ObjEnemy_SetIntersectionCircleToShot(objEnemy, GetX, GetY, 32);
- ObjEnemy_SetIntersectionCircleToPlayer(objEnemy, GetX, GetY, 24);
- yield;
- }
- @Event
- {
- alternative(GetEventType())
- case(EV_REQUEST_LIFE){SetScriptResult(2500);}
- case(EV_REQUEST_TIMER){SetScriptResult(30);}
- }
- task MainTask
- {
- ObjMove_SetX(objEnemy,cx+60);
- ObjMove_SetY(objEnemy,-120);
- ObjMove_SetDestAtFrame(objEnemy, cx, cy-90, 90);
- TWait(120);
- let ang = 90;
- let cha = 8;
- //The actual attack pattern starts here
- while(GetLife > 0)
- {
- loop
- {
- RainbowShot(ang+(1*cha),5,RED21);
- RainbowShot(ang+(1*cha),4.5,ORANGE21);
- RainbowShot(ang+(1*cha),4,YELLOW21);
- RainbowShot(ang+(1*cha),3.5,GREEN21);
- RainbowShot(ang+(1*cha),3,AQUA21);
- RainbowShot(ang+(1*cha),2.5,BLUE21);
- RainbowShot(ang+(1*cha),2,PURPLE21);
- PlaySE(Shot1);
- ang-=cha;
- TWait(2);
- }
- }
- }
- task RainbowShot(RSang,RSspeed,RSgraphic)
- {
- let obj1 = CreateShotA2(GetX,GetY,2,RSang,0.05, RSspeed,RSgraphic,10);
- while(!Obj_IsDeleted(obj1)){
- if(ObjMove_GetY(obj1)<0)
- {
- ObjMove_SetY(obj1,0.1); //right here
- ObjMove_SetAngle(obj1,180-ObjMove_GetAngle(obj1));
- }
- yield;
- }
- }
- task FinalTask
- {
- while(GetLife > 0){yield;} //Wait until death
- TWait(10);
- DeleteShotAll(TYPE_ALL, TYPE_ITEM); //All shots to item
- Obj_Delete(objEnemy); //Delete enemy
- CloseScript(GetOwnScriptID()); //End this script
- }
Add Comment
Please, Sign In to add comment