Guest User

Untitled

a guest
Jun 15th, 2011
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.27 KB | None | 0 0
  1. #TouhouDanmakufu
  2. #Title[Hell "- Edge of the fire blade -"]
  3. #Text[Not everyone can see...]
  4. #Player[FREE]
  5. #ScriptVersion[2]
  6. #BGM[bgm\Medicine.mp3]
  7.  
  8. script_enemy_main{
  9.  
  10. let CSD = GetCurrentScriptDirectory;
  11.  
  12. let imgBoss = CSD ~ "system\Kora.png";
  13. let cut = CSD ~ "system\Koracut.png";
  14. let bg = CSD ~ "system\Temple.png";
  15.  
  16. @Initialize{
  17. SetLife(5000);
  18. SetTimer(100);
  19. SetScore(100000);
  20. SetMovePosition01(GetCenterX,GetCenterY,5);
  21. LoadGraphic(imgBoss);
  22. LoadGraphic(cut);
  23. LoadGraphic(bg);
  24.  
  25. CutIn(YOUMU,"Hell - Edge of the fire blade -",cut,0,0,300,384);
  26.  
  27. mainTask;
  28. }
  29.  
  30. @MainLoop{
  31. SetCollisionA(GetX,GetY,32);
  32. SetCollisionB(GetX,GetY,16);
  33. yield;
  34. }
  35.  
  36. @DrawLoop{
  37.  
  38. // data for the boss
  39. SetTexture(imgBoss);
  40. SetRenderState(ALPHA);
  41. SetAlpha(225);
  42. SetGraphicRect(0,0,110,110);
  43. SetGraphicScale(0.5,0.5);
  44. SetGraphicAngle(0,0,0);
  45. DrawGraphic(GetX,GetY);
  46.  
  47. }
  48.  
  49. @BackGround{
  50. SetTexture(bg);
  51. SetRenderState(ALPHA);
  52. SetAlpha(225);
  53. SetGraphicRect(0,0,512,512);
  54. SetGraphicScale(1,1);
  55. SetGraphicAngle(0,0,0);
  56. DrawGraphic(GetCenterX,GetCenterY);
  57.  
  58. }
  59.  
  60. @Finalize{
  61. // delete the image from memory
  62. DeleteGraphic(imgBoss);
  63. DeleteGraphic(cut);
  64. DeleteGraphic(bg);
  65.  
  66. }
  67.  
  68. task mainTask{
  69. wait(120);
  70. yield;
  71. fire;
  72. }
  73.  
  74.  
  75. task fire{
  76. //loop{
  77. bullet(GetEnemyX,GetEnemyY,0.5,270,ORANGE32,0);
  78. wait(240);
  79. yield;
  80. //}
  81. }
  82.  
  83. task bullet(x,y,v,a,g,d){
  84. let counter=0;
  85. let obj=Obj_Create(OBJ_SHOT);
  86. Obj_SetPosition(obj,x,y);
  87. Obj_SetAngle(obj,a);
  88. Obj_SetSpeed(obj,0.9);
  89. ObjShot_SetGraphic(obj,ORANGE32);
  90. ObjShot_SetDelay(obj,20);
  91. while(!Obj_BeDeleted(obj)){
  92. counter++;
  93. if(counter==140){Obj_SetAngle(obj, atan2(GetPlayerY-Obj_GetY(obj),GetPlayerX-Obj_GetX(obj)));}
  94. if(counter==180){Obj_SetSpeed(obj,2);}
  95. if(counter==260&&d<=5){
  96. bullet(Obj_GetX(obj),Obj_GetY(obj),1,Obj_GetAngle(obj)+35+180,ORANGE32,d+1);
  97. bullet(Obj_GetX(obj),Obj_GetY(obj),2,Obj_GetAngle(obj)+0+180,ORANGE32,d+1);
  98. bullet(Obj_GetX(obj),Obj_GetY(obj),3,Obj_GetAngle(obj)-35+180,ORANGE32,d+1);
  99. }
  100. //if(counter==300){d = 0;}
  101. yield;
  102. }
  103. }
  104.  
  105. // wait function
  106. function wait(w){
  107. loop(w){yield;}
  108. }
  109.  
  110.  
  111.  
  112.  
  113. }
Advertisement
Add Comment
Please, Sign In to add comment