Mewkyuu

Untitled

Aug 31st, 2011
129
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.21 KB | None | 0 0
  1. task CreateLaserBase(objs) {
  2. let obj = ObjEffect_InitializeRect(GetCurrentScriptDirectory~"shot_all.png", 3);
  3. ObjEffect_SetUVRect(obj, 274, 332, 291, 349);
  4. ObjEffect_SetRenderState(obj, ADD);
  5. while(!Obj_BeDeleted(objs)){
  6. Obj_SetPosition(obj, Obj_GetX(objs), Obj_GetY(objs));
  7. ObjEffect_SetXYRect(obj, -16, -16, 16, 16);
  8. ObjEffect_SetAngle(obj, 0, 0, Obj_GetAngle(objs));
  9. ObjEffect_SetScale(obj, (ObjLaser_GetWidth(objs)*3/2)/32, (ObjLaser_GetWidth(objs)*3/2)/32);
  10. wait(1);
  11. }
  12. Obj_Delete(obj);
  13. }
  14. task CreateSpark(ang,side) {
  15. let obj = Obj_Create(OBJ_LASER);
  16. CreateLaserBase(obj);
  17. Obj_SetPosition(obj, GetX, GetY);
  18. Obj_SetAngle(obj, ang);
  19. Obj_SetSpeed(obj, 8);
  20. ObjShot_SetGraphic(obj, ORANGE60);
  21. ObjLaser_SetLength(obj, 0);
  22. ObjLaser_SetWidth(obj, 25);
  23. ObjLaser_SetSource(obj, false);
  24. Obj_SetCollisionToPlayer(obj, false);
  25. loop(10){
  26. ObjLaser_SetLength(obj, ObjLaser_GetLength(obj)+500/10);
  27. wait(1);
  28. } wait(80);
  29. Obj_SetCollisionToPlayer(obj, true);
  30. loop(10){
  31. ObjLaser_SetWidth(obj, ObjLaser_GetWidth(obj)+325/10);
  32. wait(1);
  33. } wait(30); loop(120) { CreateBounceShot(Obj_GetAngle(obj)); Obj_SetAngle(obj, Obj_GetAngle(obj)+1/3*side); wait(1); } Obj_Delete(obj);
  34. }
  35. task CreateBounceShot(a) {
  36. let obj = Obj_Create(OBJ_SHOT);
  37. Obj_SetPosition(obj, GetX, GetY);
  38. Obj_SetAngle(obj, a+rand(-5,5));
  39. Obj_SetSpeed(obj, rand(13, 17));
  40. ObjShot_SetGraphic(obj, WHITE31);
  41. let w = 0;
  42. while(!Obj_BeDeleted(obj) && !w){
  43. if(Obj_GetX(obj)<GetClipMinX){
  44. Obj_SetX(obj, 2*GetClipMinX-Obj_GetX(obj));
  45. Obj_SetAngle(obj, 180-Obj_GetAngle(obj));
  46. w = 1;
  47. }
  48. if(Obj_GetX(obj)>GetClipMaxX){
  49. Obj_SetX(obj, 2*GetClipMaxX-Obj_GetX(obj));
  50. Obj_SetAngle(obj, 180-Obj_GetAngle(obj));
  51. w = 1;
  52. }
  53. if(Obj_GetY(obj)<GetClipMinY){
  54. Obj_SetY(obj, 2*GetClipMinY-Obj_GetY(obj));
  55. Obj_SetAngle(obj, -Obj_GetAngle(obj));
  56. w = 1;
  57. }
  58. if(Obj_GetY(obj)>GetClipMaxY){
  59. Obj_SetY(obj, 2*GetClipMaxY-Obj_GetY(obj));
  60. Obj_SetAngle(obj, -Obj_GetAngle(obj));
  61. w = 1;
  62. }
  63. wait(1);
  64. }
  65. ObjShot_SetGraphic(obj, rand_int(RED12, WHITE12));
  66. Obj_SetAngle(obj, Obj_GetAngle(obj)+rand(-45,45));
  67. Obj_SetSpeed(obj, 3);
  68. }
Advertisement
Add Comment
Please, Sign In to add comment