Guest User

Untitled

a guest
Aug 14th, 2013
219
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.14 KB | None | 0 0
  1. script_enemy_main{
  2.  
  3. let CSD = GetCurrentScriptDirectory;
  4.  
  5. let imgFam = CSD ~ "system\familiar.png";
  6.  
  7. let spin = 0;
  8.  
  9. let FamAngle = GetArgument;
  10.  
  11. let shot0 = CSD ~ "sfx\se_plst00.wav";
  12.  
  13. @Initialize{
  14. SetLife(10);
  15.  
  16. LoadGraphic(imgFam);
  17.  
  18. LoadSE(shot0);
  19.  
  20. maintask;
  21. }
  22.  
  23. @MainLoop{
  24. yield;
  25. }
  26.  
  27. @DrawLoop{
  28. SetTexture(imgFam);
  29. SetRenderState(ALPHA);
  30. SetAlpha(255);
  31. SetGraphicRect(0,0,48,48);
  32. SetGraphicScale(1,1);
  33. SetGraphicAngle(0,0,spin);
  34.  
  35. if(GetKeyState(VK_SLOWMOVE)==KEY_PUSH || GetKeyState(VK_SLOWMOVE)==KEY_HOLD){ SetGraphicRect(0,48,48,96);}
  36. else{ SetGraphicRect(0,0,48,48);}
  37.  
  38. DrawGraphic(GetX,GetY);
  39. spin+=10;
  40. }
  41.  
  42. @Finalize{
  43. DeleteGraphic(imgFam);
  44.  
  45. DeleteSE(shot0);
  46. }
  47.  
  48. task maintask{
  49. yield;
  50. fire;
  51. movement;
  52. }
  53.  
  54. //fires in a spiral pattern
  55. task fire{
  56. let dir = rand(0,359);
  57. loop{
  58. CreateShot01(GetX,GetY,1,dir,158,10);
  59. PlaySE(shot0);
  60. dir+=30;
  61. wait(5);
  62. }
  63. }
  64.  
  65. //moves the familiar past the player
  66. task movement{
  67. SetAngle(GetAngleToPlayer+FamAngle);
  68. SetSpeed(6);
  69. }
  70.  
  71. function wait(w){ loop(w){ yield;}}
  72.  
  73. }
Advertisement
Add Comment
Please, Sign In to add comment