Advertisement
Guest User

Faulty Boss Animation

a guest
May 25th, 2012
106
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.86 KB | None | 0 0
  1. #TouhouDanmakufu
  2. #Title[Wind Bullets 2]
  3. #Text[(easy)]
  4. #Player[FREE]
  5. #ScriptVersion[2]
  6.  
  7. script_enemy_main{
  8.  
  9. let CSD = GetCurrentScriptDirectory;
  10.  
  11. let intro = CSD ~ "img/MennesAnimation.png";
  12. let imgBoss = CSD ~ "img/Mennes.png";
  13. let attack = CSD ~ "img/Mennes2.png";
  14. let cut = CSD ~ "img/MennesCut.png";
  15. let bg = CSD ~ "img/Stars.png";
  16.  
  17. let introdone = 0;
  18. let frame = 1;
  19. let frameX = 0;
  20. let frameY = 0;
  21.  
  22. @Initialize{
  23. SetLife(1000);
  24. SetTimer(60);
  25. SetScore(100000);
  26. SetMovePosition01(GetCenterX,120,5);
  27.  
  28. LoadGraphic(imgBoss);
  29. LoadGraphic(attack);
  30. LoadGraphic(cut);
  31. LoadGraphic(bg);
  32.  
  33. CutIn(YOUMU,"Wind Bullets - easy -",cut,0,0,200,127);
  34.  
  35. mainTask;
  36.  
  37. }
  38.  
  39. @MainLoop{
  40. SetCollisionA(GetX,GetY,57);
  41. SetCollisionB(GetX,GetY,40);
  42.  
  43. yield;
  44. }
  45.  
  46. @DrawLoop{
  47.  
  48. if(introdone == 0 && GetEnemyX == GetCenterX && GetEnemyY == 120) {
  49. if((frame/10 - truncate(frame/10)) == 0){
  50. frameX++;
  51. if(frameX == 4){
  52. frameX = 0;
  53. frameY++;
  54. if(frameY == 4){frameY = 0; }
  55. }
  56. }
  57. frame++;
  58. if(frame == 150){introdone = 1; }
  59. SetTexture(intro);
  60. SetRenderState(ALPHA);
  61. SetAlpha(255);
  62. SetGraphicScale(1,1);
  63. SetGraphicAngle(0,0,0);
  64. SetGraphicRect(frameX*78,frameY*127,78+frameX*78,127+frameY*127);
  65. DrawGraphic(GetX,GetY);
  66. }
  67.  
  68. if(introdone == 0 && (GetEnemyX != GetCenterX || GetEnemyY != 120)) {
  69. SetTexture(imgBoss);
  70. SetRenderState(ALPHA);
  71. SetAlpha(255);
  72. SetGraphicScale(1,1);
  73. SetGraphicAngle(0,0,0);
  74. SetGraphicRect(0,0,78,114);
  75. DrawGraphic(GetX,GetY);
  76. }
  77. if(introdone == 1) {
  78. SetTexture(intro);
  79. SetRenderState(ALPHA);
  80. SetAlpha(255);
  81. SetGraphicScale(1,1);
  82. SetGraphicAngle(0,0,0);
  83. SetGraphicRect(234,381,312,508);
  84. DrawGraphic(GetX,GetY);
  85. }
  86. }
  87.  
  88. @BackGround{
  89.  
  90. SetTexture(bg);
  91. SetRenderState(ALPHA);
  92. SetAlpha(255);
  93. SetGraphicRect(0,0,512,512);
  94. SetGraphicScale(1,1);
  95. SetGraphicAngle(0,0,0);
  96. DrawGraphic(GetCenterX,GetCenterY);
  97.  
  98. }
  99.  
  100. @Finalize{
  101.  
  102. DeleteGraphic(imgBoss);
  103. DeleteGraphic(attack);
  104. DeleteGraphic(cut);
  105. DeleteGraphic(bg);
  106.  
  107.  
  108. }
  109.  
  110. //main task, activates stuff
  111. task mainTask{
  112. if(introdone == 1){
  113. wait(120);
  114. yield;
  115. fire;
  116. movement;
  117. }
  118. }
  119.  
  120. task movement{
  121. loop{
  122. SetMovePosition01(GetCenterX-100,120,5);
  123. wait(120);
  124. SetMovePosition01(GetCenterX+100,120,5);
  125. wait(120);
  126. yield;
  127. }
  128. }
  129.  
  130. task fire{
  131. let x = 0;
  132. let dir = 0;
  133. loop{
  134. while ( x < 36 ) {
  135. let MouthY = GetEnemyY+30;
  136.  
  137. CreateShotA(1,GetEnemyX+50*cos(dir),MouthY+50*sin(dir),30);
  138.  
  139. SetShotDataA(1,0,0,dir,0,0,0,WHITE01);
  140.  
  141. SetShotDataA(1,60,2,dir,0.5,0,2,WHITE01);
  142.  
  143. FireShot(1);
  144.  
  145. dir += 360/36;
  146. x++;
  147. }
  148. x = 0;
  149. dir = 0;
  150. wait(60);
  151. yield;
  152. }
  153. }
  154.  
  155. //wait function
  156. function wait (w){
  157. loop(w){yield;}
  158.  
  159. }
  160.  
  161.  
  162. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement