Advertisement
Vampiric

Untitled

Jan 1st, 2015
299
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.28 KB | None | 0 0
  1. #TouhouDanmakufu[Single]
  2. #ScriptVersion[3]
  3. #Title["SampleA01"]
  4. #Text["SampleA01:Shooting Bullets Straight Down"]
  5. #Player["./Player/Arisa.txt"]
  6. #include"script/default_system/Default_ShotConst.txt"
  7.  
  8. //----------------------------------------------------
  9.  
  10. let objEnemy;
  11. let frame = 0;
  12. let disk;
  13. let objE;
  14. let cut = GetCurrentScriptDirectory ~ "cirnocut.png";
  15.  
  16.  
  17. @Event
  18. {
  19. alternative(GetEventType())
  20. case(EV_REQUEST_LIFE)
  21. {
  22.  
  23. SetScriptResult(8000);
  24. }
  25. }
  26.  
  27. @Initialize
  28. {
  29. SetPlayerLife(99);
  30. objEnemy = ObjEnemy_Create(OBJ_ENEMY_BOSS);
  31. ObjEnemy_Regist(objEnemy);
  32.  
  33.  
  34. let imgExRumia = GetCurrentScriptDirectory ~ "/img/51906.png";
  35. ObjPrim_SetTexture(objEnemy, imgExRumia);
  36. ObjSprite2D_SetSourceRect(objEnemy, 245, 797, 283, 852);
  37. ObjSprite2D_SetDestCenter(objEnemy);
  38.  
  39. Obj_SetRenderPriorityI(GetPlayerObjectID,99);
  40. let cx = GetStgFrameWidth() / 2;
  41. ObjMove_SetDestAtFrame(objEnemy, cx, 60, 1);
  42. maintask;
  43. }
  44.  
  45. @MainLoop
  46. {
  47.  
  48. yield;
  49. }
  50.  
  51. task maintask{
  52. renderBG;
  53.  
  54. Enemi;
  55.  
  56. ShotTask;
  57. }
  58.  
  59. task Enemi{
  60. while(ObjEnemy_GetInfo(objEnemy, INFO_LIFE) > 0){ let ex = ObjMove_GetX(objEnemy);
  61. let ey = ObjMove_GetY(objEnemy); ObjEnemy_SetIntersectionCircleToShot(objEnemy, ex, ey, 32); yield;}
  62.  
  63. Obj_Delete(objEnemy);
  64. CloseScript(GetOwnScriptID());
  65. return;
  66. }
  67.  
  68. task renderBG{
  69. let path = GetCurrentScriptDirectory ~ "/img/PC Computer - Touhou Fuujinroku Mountain of Faith - Stage Tilesets and Textures.png";
  70. let bg = ObjPrim_Create(OBJ_SPRITE_2D);
  71. ObjPrim_SetTexture(bg,path);
  72. ObjSprite2D_SetSourceRect(bg,1290,890,1799,1335);
  73. ObjSprite2D_SetDestRect(bg,0,0,GetStgFrameWidth,GetStgFrameHeight);
  74. Obj_SetRenderPriorityI(bg,21);
  75.  
  76. }
  77. task ShotTask{
  78. Shots;
  79. loop(300){yield;}
  80. Shots2;
  81. loop(300){yield;}
  82. Shots3;
  83. loop(600){yield;}
  84. Shots;
  85. Shots2;
  86. Shots3;
  87. loop(300){yield;}
  88. Shots;
  89. Shots2;
  90. Shots3;
  91. loop(300){yield;}
  92. Shots;
  93. Shots2;
  94. Shots3;
  95. loop(300){yield;}
  96. Shots;
  97. Shots2;
  98. Shots3;
  99. loop(300){yield;}
  100. Shots;
  101. Shots2;
  102. Shots3;
  103. loop(300){yield;}
  104. }
  105. task Shots {
  106. let x=0;
  107. let y=0;
  108. while(ObjEnemy_GetInfo(objEnemy, INFO_LIFE) > 0){
  109. loop(50){
  110. let obj = ObjShot_Create(OBJ_SHOT);
  111. ObjShot_SetDelay(obj,10);
  112. ObjShot_SetGraphic(obj,DS_SCALE_PURPLE);
  113. ObjMove_SetPosition(obj,x,y);
  114. ObjMove_SetAngle(obj,rand(0,360));
  115. ObjMove_SetSpeed(obj,0);
  116. ObjShot_Regist(obj);
  117. x+=10;
  118. y+=5+rand(1,3);
  119. ObjMove_AddPatternA1(obj,70,3,rand(0,360));
  120. }
  121.  
  122. loop(300){yield;}
  123. x=0;
  124. y=0;
  125.  
  126. yield;}
  127. }
  128.  
  129.  
  130. task Shots2 {
  131. let x=500;
  132. let y=0;
  133. while(ObjEnemy_GetInfo(objEnemy, INFO_LIFE) > 0){
  134. loop(50){
  135. let obj = ObjShot_Create(OBJ_SHOT);
  136. ObjShot_SetDelay(obj,10);
  137. ObjShot_SetGraphic(obj,DS_SCALE_WHITE);
  138. ObjMove_SetPosition(obj,x,y);
  139. ObjMove_SetSpeed(obj,0);
  140. ObjMove_SetAngle(obj,rand(0,360));
  141. ObjShot_Regist(obj);
  142. x-=10;
  143. y+=5+rand(1,3);
  144. ObjMove_AddPatternA1(obj,70,3,rand(0,360));
  145. }
  146.  
  147. loop(300){yield;}
  148. x=500;
  149. y=0;
  150.  
  151. yield;}
  152. }
  153.  
  154. task Shots3 {
  155. let x=0;
  156. let y=100;
  157. while(ObjEnemy_GetInfo(objEnemy, INFO_LIFE) > 0){
  158. loop(50){
  159. let obj = ObjShot_Create(OBJ_SHOT);
  160. ObjShot_SetDelay(obj,10);
  161. ObjShot_SetGraphic(obj,DS_SCALE_RED);
  162. ObjMove_SetPosition(obj,x,y);
  163. ObjMove_SetSpeed(obj,0);
  164. ObjMove_SetAngle(obj,rand(0,360));
  165. ObjShot_Regist(obj);
  166. x+=10;
  167. y=100+rand(-5,5);
  168. ObjMove_AddPatternA1(obj,70,3,rand(0,360));
  169. }
  170. loop(300){yield;}
  171. x=0;
  172. y=0;
  173.  
  174. yield;}
  175. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement