Guest User

obj laser tasks

a guest
Sep 6th, 2013
50
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.81 KB | None | 0 0
  1. task fire{
  2. loop{
  3. let sx = GetClipMinX;
  4. let sy = GetCenterY+rand(-100,100);
  5. let ex = GetClipMaxX;
  6. let ey = GetCenterY+rand(-100,100);
  7. sword(sx,sy,atan2(ey-sy,ex-sx),((ex-sx)^2+(ey-sy)^2)^0.5,15,4,90);
  8. wait(240);
  9. }
  10. }
  11.  
  12. task sword(x,y,angle,length,width,graphic,delay){
  13. let obj = Obj_Create(OBJ_LASER);
  14. let x = 0;
  15. let y = 0;
  16.  
  17. Obj_SetPosition(obj,x,y);
  18. Obj_SetAngle(obj,angle);
  19. ObjLaser_SetLength(obj,length);
  20. ObjLaser_SetWidth(obj,width);
  21. ObjShot_SetGraphic(obj,graphic);
  22. ObjShot_SetDelay(obj,delay);
  23. ObjShot_SetBombResist(obj,true);
  24. ObjLaser_SetSource(obj,false);
  25.  
  26. wait(120);
  27. loop(25){
  28. CreateShot01((Obj_GetX(obj)+ObjLaser_GetEndX(obj))/2,(Obj_GetY(obj)+ObjLaser_GetEndY(obj))/2,rand(0.5,3),rand(0,359),14,0);
  29. }
  30. wait(15);
  31. Obj_Delete(obj);
  32. }
Advertisement
Add Comment
Please, Sign In to add comment