Advertisement
Guest User

ohdsxuicxhdeosuiho8uevgh

a guest
Jun 9th, 2013
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.52 KB | None | 0 0
  1. script_enemy_main{
  2. let D = GetCurrentScriptDirectory;
  3. let imgFam = D ~ "system\Familiar3.png";
  4. let s1 = D ~ "sfx\Shot.wav";
  5. @Initialize{
  6. SetLife(200);
  7. LoadGraphic(imgFam);
  8. LoadSE(s1);
  9. fire;
  10. //fireb;
  11. }
  12. @MainLoop{
  13. SetCollisionA(GetX,GetY,16);
  14. SetCollisionB(GetX,GetY,16);
  15. yield;
  16. }
  17. @DrawLoop{
  18. SetTexture(imgFam);
  19. SetRenderState(ALPHA);
  20. SetAlpha(255);
  21. SetGraphicRect(0,0,88,90);
  22. SetGraphicScale(0.5,0.5);
  23. SetGraphicAngle(0,0,0);
  24. DrawGraphic(GetX,GetY);
  25. }
  26. @Finalize{
  27. loop(3){CreateItem(ITEM_SCORE,GetX-rand(0,30),GetY-rand(0,30));}
  28. DeleteSE(s1);}
  29. task fire{
  30. loop(5){
  31. let dir = GetAngleToPlayer;
  32. loop(32){bullet(GetX,GetY,2,dir,BLUE21,0); dir+=12.25}
  33. PlaySE(s1);
  34. wait(60);
  35. dir=GetAngleToPlayer;
  36. }
  37. }
  38. task fireb{
  39. let dir = GetAngleToPlayer;
  40. let thing = 2;
  41. loop(10){
  42. loop(6){
  43. loop(4){CreateShot01(GetX,GetY,thing,dir,BLUE04,0); dir+=90; }
  44. thing+=0.4;}
  45. PlaySE(s1);
  46. wait(20);
  47. dir+=17;
  48. thing = 2;
  49. }
  50. }
  51. task bullet(x,y,v,dir,graphic,delay){
  52. let obj=Obj_Create(OBJ_SHOT);
  53.  
  54.  
  55. Obj_SetPosition(obj,x,y);
  56.  
  57.  
  58.  
  59. Obj_SetSpeed(obj,v);
  60.  
  61.  
  62. Obj_SetAngle(obj,dir);
  63. ObjShot_SetGraphic(obj,graphic);
  64.  
  65.  
  66. ObjShot_SetDelay(obj,delay);
  67.  
  68.  
  69. ObjShot_SetBombResist(obj, true);
  70.  
  71. while(!Obj_BeDeleted(obj)){
  72. loop(20){Obj_SetSpeed(obj, Obj_GetSpeed(obj) - 0.1); wait(3);}
  73. wait(20);
  74. Obj_SetAngle(obj,atan2(Obj_GetY(obj) - GetPlayerY, Obj_GetX(obj) - GetPlayerX));
  75. Obj_SetSpeed(obj,3);
  76.  
  77. wait(9999999);
  78. }}
  79. function wait(w){loop(w){yield;}}
  80. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement