Guest User

Untitled

a guest
Oct 16th, 2017
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.53 KB | None | 0 0
  1. #include"./lib/lib.txt"
  2.  
  3. @Initialize
  4. {
  5. InitSub;
  6. MainTask;
  7. DrawTask(0);
  8. FinalTask;
  9. }
  10.  
  11. @Loading
  12. {
  13. LoadSound(Shot1);
  14. }
  15.  
  16. @MainLoop
  17. {
  18. ObjEnemy_SetIntersectionCircleToShot(objEnemy, GetX, GetY, 32);
  19. ObjEnemy_SetIntersectionCircleToPlayer(objEnemy, GetX, GetY, 24);
  20. yield;
  21. }
  22.  
  23. @Event
  24. {
  25. alternative(GetEventType())
  26. case(EV_REQUEST_LIFE){SetScriptResult(2500);}
  27. case(EV_REQUEST_TIMER){SetScriptResult(30);}
  28. }
  29.  
  30. task MainTask
  31. {
  32. ObjMove_SetX(objEnemy,cx+60);
  33. ObjMove_SetY(objEnemy,-120);
  34. ObjMove_SetDestAtFrame(objEnemy, cx, cy-90, 90);
  35. TWait(120);
  36.  
  37. let ang = 90;
  38. let cha = 8;
  39.  
  40. //The actual attack pattern starts here
  41. while(GetLife > 0)
  42. {
  43. loop
  44. {
  45. RainbowShot(ang+(1*cha),5,RED21);
  46. RainbowShot(ang+(1*cha),4.5,ORANGE21);
  47. RainbowShot(ang+(1*cha),4,YELLOW21);
  48. RainbowShot(ang+(1*cha),3.5,GREEN21);
  49. RainbowShot(ang+(1*cha),3,AQUA21);
  50. RainbowShot(ang+(1*cha),2.5,BLUE21);
  51. RainbowShot(ang+(1*cha),2,PURPLE21);
  52. PlaySE(Shot1);
  53. ang-=cha;
  54.  
  55. TWait(2);
  56. }
  57.  
  58. }
  59.  
  60. }
  61.  
  62.  
  63. task RainbowShot(RSang,RSspeed,RSgraphic)
  64. {
  65. let obj1 = CreateShotA2(GetX,GetY,2,RSang,0.05, RSspeed,RSgraphic,10);
  66.  
  67. while(!Obj_IsDeleted(obj1)){
  68. if(ObjMove_GetY(obj1)<0)
  69. {
  70. ObjMove_SetY(obj1,0.1); //right here
  71. ObjMove_SetAngle(obj1,180-ObjMove_GetAngle(obj1));
  72. }
  73. yield;
  74. }
  75. }
  76.  
  77. task FinalTask
  78. {
  79. while(GetLife > 0){yield;} //Wait until death
  80. TWait(10);
  81. DeleteShotAll(TYPE_ALL, TYPE_ITEM); //All shots to item
  82. Obj_Delete(objEnemy); //Delete enemy
  83. CloseScript(GetOwnScriptID()); //End this script
  84. }
Add Comment
Please, Sign In to add comment