Guest User

Danmakufu is so hard to understand sometimes >.<!

a guest
Mar 28th, 2012
108
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.59 KB | None | 0 0
  1. #TouhouDanmakufu
  2. #Title[Sprite Animation Test]
  3. #Text[Why u no work?!]
  4. #Player[FREE]
  5. #ScriptVersion[2]
  6. #BGM[.\system\0_4.mp3]
  7.  
  8. script_enemy_main{
  9. let CSD = GetCurrentScriptDirectory;
  10.  
  11. #include_function ".\AnimationLib.dnh";
  12.  
  13. let spriteKoishi = CSD ~ ".\bosskoishi.png";
  14.  
  15.  
  16.  
  17. @Initialize{
  18. SetLife(10000);
  19. SetPlayerInvincibility(1000000);
  20. SetTimer(70);
  21. SetScore(100000000);
  22. SetMovePosition01(GetCenterX,GetCenterY,3);
  23.  
  24. LoadGraphic(spriteKoishi);
  25.  
  26. CreateAnimation("koishi", "idle", 4);
  27. SetAnimationFrame("koishi", "idle", 0, spriteKoishi, 12, 0, 0, 64, 64);
  28. SetAnimationFrame("koishi", "idle", 1, spriteKoishi, 12, 64, 0, 128, 64);
  29. SetAnimationFrame("koishi", "idle", 2, spriteKoishi, 12, 128, 0, 192, 64);
  30. SetAnimationFrame("koishi", "idle", 3, spriteKoishi, 12, 192, 0, 256, 64);
  31.  
  32. CreateAnimation("koishi", "shoot", 4);
  33. SetAnimationFrame("koishi", "shoot", 0, spriteKoishi, 4, 0, 128, 64, 192);
  34. SetAnimationFrame("koishi", "shoot", 1, spriteKoishi, 4, 64, 128, 128, 192);
  35. SetAnimationFrame("koishi", "shoot", 2, spriteKoishi, 4, 128, 128, 192, 192);
  36. SetAnimationFrame("koishi", "shoot", 3, spriteKoishi, 4, 192, 128, 256, 192);
  37.  
  38. CreateAnimation("koishi", "move left", 4);
  39. SetAnimationFrame("koishi", "move left", 0, spriteKoishi, 12, 0, 64, 64, 128);
  40. SetAnimationFrame("koishi", "move left", 1, spriteKoishi, 12, 64, 64, 128, 128);
  41. SetAnimationFrame("koishi", "move left", 2, spriteKoishi, 12, 128, 64, 192, 128);
  42. SetAnimationFrame("koishi", "move left", 3, spriteKoishi, 12, 192, 64, 256, 128);
  43.  
  44. Animate("koishi", "idle", true);
  45.  
  46.  
  47. mainTask;
  48. }
  49.  
  50. @MainLoop{
  51. SetCollisionA(GetX,GetY,32);
  52. SetCollisionB(GetX,GetY,24);
  53.  
  54.  
  55. yield;
  56.  
  57. }
  58.  
  59. @DrawLoop{
  60. SetTexture(spriteKoishi);
  61. SetRenderState(ALPHA);
  62. SetAlpha(255);
  63. SetGraphicScale(1,1);
  64. SetGraphicAngle(0,0,0);
  65.  
  66. DrawAnimatedSprite("koishi",GetX,GetY);
  67.  
  68.  
  69. }
  70.  
  71.  
  72. @Background{
  73.  
  74. }
  75.  
  76. @Finalize{
  77.  
  78. DeleteGraphic(spriteKoishi);
  79. }
  80.  
  81. task mainTask{
  82. yield;
  83. wait(120);
  84. fire1;
  85. movement;
  86.  
  87. }
  88.  
  89. task fire1{
  90. loop{
  91. wait(120);
  92. Animate("koishi", "shoot", false);
  93. CreateShot01(GetX,GetY,2,GetAngleToPlayer,RED01,0);
  94. wait(60);
  95. Animate("koishi", "idle", true);
  96. yield;
  97. }
  98. }
  99.  
  100. task movement{
  101. loop{
  102. Animate("koishi", "move left", false);
  103. SetMovePosition01(GetCenterX-100, GetCenterY, 3);
  104.  
  105. Animate("koishi", "move left", false);
  106.  
  107. SetGraphicAngle(180, 0, 0);
  108. SetMovePosition01(GetCenterX+100, GetCenterY, 3);
  109. yield;
  110. }
  111. }
  112.  
  113.  
  114.  
  115. function wait(w){
  116. loop(w){yield;}
  117. }
  118.  
  119. }
Advertisement
Add Comment
Please, Sign In to add comment