Lunarethic

Untitled

Sep 16th, 2021
43
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.30 KB | None | 0 0
  1. task CreateNeedle(x, y) {
  2. let shotObj = CreateShotC2(x, y, 0, 0, 0, 0, ARROWHEAD_GREEN, 0);
  3. let reflect = false;
  4. ObjMove_AddPatternB2(shotObj, 0, rand(1.50,-1.50), 2 , 0, -0.050, 2, -3);
  5.  
  6. while(!Obj_IsDeleted(shotObj)) {
  7. if(ObjMove_GetY(shotObj) < 0 && reflect == false) {
  8. PlaySoundA1("shot", 90, 0);
  9. NeedleLaser(GetObjX(shotObj), GetObjY(shotObj), GetPlayerAngle(shotObj));
  10. reflect = true;
  11. Obj_Delete(shotObj);
  12. }
  13. yield;
  14. }
  15.  
  16. task NeedleLaser(x, y, ang) {
  17. let mainObj = LLaserC1(x, y, 6, ang, 300, 6, SMALL_RED);
  18. let count = 0;
  19. let angle = 0;
  20. let reflect2 = false;
  21.  
  22. loop(2){
  23. let id = CLaserC1(ObjMove_GetX(mainObj), ObjMove_GetY(mainObj),0,angle,120,6,SMALL_WHITE);
  24. Spiraling(id, angle);
  25. angle += 180/2;
  26. }
  27.  
  28. while(!Obj_IsDeleted(mainObj)){
  29. if(ObjMove_GetY(mainObj) > STGFRAME_HEIGHT+50 && reflect2==false) {
  30. PlaySoundA1("reversea",90,0);
  31. reflect2=true;
  32. Obj_Delete(mainObj);
  33. }
  34. yield;
  35. }
  36.  
  37. task Spiraling(id, angle) {
  38. let r = 0;
  39. let r2 = 60;
  40. let timer = 0;
  41.  
  42. while(!Obj_IsDeleted(mainObj)) {
  43. timer++;
  44. r2-=0.50;
  45. if(timer%3==0){
  46. SuddenAppearBullet(ObjMove_GetX(id), ObjMove_GetY(id));
  47. }
  48. let sX = GetEllipticX(ObjMove_GetX(mainObj), r, r2, angle, ang);
  49. let sY = GetEllipticY(ObjMove_GetY(mainObj), r, r2, angle, ang);
  50. let trueAngle = angle + ang;
  51.  
  52. ObjMove_SetPosition(id, sX, sY);
  53. ObjMove_SetAngle(id, trueAngle);
  54. angle += 8;
  55. yield;
  56. }
  57.  
  58. Obj_Delete(id);
  59.  
  60. task SuddenAppearBullet(x,y){
  61. let hidden = CreateShotC1(x,y, 0, 0, BL_SMALL_GREEN, 0);
  62. Obj_SetVisible(hidden,false);
  63.  
  64. while(!Obj_IsDeleted(mainObj)){yield;}
  65. let tanglelaser = CreateShotC1(ObjMove_GetX(hidden), ObjMove_GetY(hidden), 0, 0, BL_SMALL_GREEN, 10);
  66. /*
  67. let fakethread = CLaserC1(ObjMove_GetX(tanglelaser), ObjMove_GetY(tanglelaser),0,angle+90,80,2,SMALL_WHITE);
  68. ObjMove_AddPatternA2(fakethread,0,8,NO_CHANGE,8,rand(-0.90,0.90),8);
  69. */
  70. }
  71.  
  72. }
  73. }
  74. }
Advertisement
Add Comment
Please, Sign In to add comment