Mewkyuu

Untitled

Jul 11th, 2011
209
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.99 KB | None | 0 0
  1. function Dist(fromx, fromy, tox, toy) { return ((tox-fromx)^2+(toy-fromy)^2)^0.5 }
  2. function AngTo(fromx, fromy, tox, toy) { return atan2(toy-fromy, tox-fromx) }
  3. task CreateChain {
  4. let obja = [0, 0, 0];
  5. task s1 { obja[0] = Obj_Create(OBJ_SHOT); let obj = obja[0];
  6. Obj_SetPosition(obj, GetClipMinX, -30); ObjShot_SetGraphic(obj, ORANGE03);
  7. ObjShot_SetBombResist(obj, 1); Obj_SetAutoDelete(obj, 0);
  8. while(Obj_GetY(obj)<525) { Obj_SetY(obj, Obj_GetY(obj)+2); yield; } Obj_Delete(obj); }
  9. task s2 { obja[1] = Obj_Create(OBJ_SHOT); let obj = obja[1];
  10. Obj_SetPosition(obj, GetClipMaxX, -30); ObjShot_SetGraphic(obj, ORANGE03);
  11. ObjShot_SetBombResist(obj, 1); Obj_SetAutoDelete(obj, 0);
  12. while(Obj_GetY(obj)<525) { Obj_SetY(obj, Obj_GetY(obj)+2); yield; } Obj_Delete(obj); }
  13. task s3 {
  14. task s4(percent) { let obj2 = Obj_Create(OBJ_SHOT);
  15. ObjShot_SetGraphic(obj2, ORANGE01);
  16. ObjShot_SetBombResist(obj2, 1); Obj_SetAutoDelete(obj2, 0);
  17. while(Obj_GetY(obj2)<525) {
  18. Obj_SetPosition(obj2,
  19. Obj_GetX(obj)+ObjLaser_GetLength(obj)*percent*cos(Obj_GetAngle(obj))
  20. ,Obj_GetY(obj)+ObjLaser_GetLength(obj)*percent*sin(Obj_GetAngle(obj))+2
  21. ); yield;
  22. }
  23. Obj_Delete(obj); }
  24. SetShotColor(255, 155, 0); obja[2] = Obj_Create(OBJ_LASER); let obj = obja[2];
  25. ObjShot_SetGraphic(obj, ORANGE12); ObjShot_SetDelay(obj, 600);
  26. ObjShot_SetBombResist(obj, 1); Obj_SetAutoDelete(obj, 0); SetShotColor(255, 255, 255);
  27. Obj_SetCollisionToPlayer(obj, 0); ObjLaser_SetSource(obj, 0);
  28. let num = 13; ascent(i in 0..num) { s4(i/num); }
  29. let a = 0; let b = 0; let r1 = rand(-3, 3); let r2 = rand(-3, 3);
  30. while(!Obj_BeDeleted(obja[0]) && !Obj_BeDeleted(obja[1])) {
  31. let x = Obj_GetX(obja[0])+15*cos(a); let y = Obj_GetY(obja[0])+15*sin(a);
  32. let x2 = Obj_GetX(obja[1])+15*cos(b); let y2 = Obj_GetY(obja[1])+15*sin(b);
  33. a+=r1; b+=r2; a%=360; b%=360;
  34. Obj_SetPosition(obj, x, y);
  35. ObjLaser_SetLength(obj, Dist(x, y, x2, y2));
  36. Obj_SetAngle(obj, AngTo(x, y, x2, y2));
  37. yield; } Obj_Delete(obj); }
  38. s1; s2; s3;
  39. }
Advertisement
Add Comment
Please, Sign In to add comment