Advertisement
Lavalake

Player Error ReimuA

Nov 19th, 2012
117
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.61 KB | None | 0 0
  1. #TouhouDanmakufu[Player]
  2. #ScriptVersion[2]
  3. #Menu[Reimu A]
  4. #Text[Reimu Hakurei - Homing Type
  5.  
  6. Shot:
  7. Both: Homing Amulets (Homing)
  8.  
  9. Spell Cards:
  10. Homing Sign - Orbs of Hakerei
  11. Homing Sign - Border of Homing Orbs]
  12. #Image[.\Reimu_Select.png]
  13. #ReplayName[ReimuA]
  14.  
  15. script_player_main{
  16. let Img_Reimu = GetCurrentScriptDirectory()~"Reimu-Dot.png";
  17. let optionxpos = 16;
  18. let optionypos = 0;
  19. let count=-1;
  20. let i=0;
  21.  
  22. task Option(position){
  23. let objoption=Obj_Create(OBJ_EFFECT);
  24. Obj_SetAlpha(objoption,200);
  25. ObjEffect_SetTexture(objoption,Img_Reimu); //uses ying-yang from spritesheet
  26. ObjEffect_SetRenderState(objoption,ALPHA);
  27. ObjEffect_SetPrimitiveType(objoption,PRIMITIVE_TRIANGLEFAN);
  28. ObjEffect_CreateVertex(objoption,4); // square object with 4 vertexes
  29. ObjEffect_SetVertexUV(objoption,0,127,17); // four coordinates of orb on spritesheet
  30. ObjEffect_SetVertexUV(objoption,1,142,17); // object is 15x15
  31. ObjEffect_SetVertexUV(objoption,2,142,32);
  32. ObjEffect_SetVertexUV(objoption,3,127,32);
  33. if(position=="LEFT"){
  34. while(!Obj_BeDeleted(objoption)){
  35. ObjEffect_SetVertexXY(objoption,0,GetPlayerX-optionxpos-8,GetPlayerY+optionypos-7);
  36. ObjEffect_SetVertexXY(objoption,1,GetPlayerX-optionxpos+6,GetPlayerY+optionypos-7);
  37. ObjEffect_SetVertexXY(objoption,2,GetPlayerX-optionxpos+6,GetPlayerY+optionypos+7);
  38. ObjEffect_SetVertexXY(objoption,3,GetPlayerX-optionxpos-8,GetPlayerY+optionypos+7);
  39. yield; // note that the left orb is shifted one pixel to the left to make the total width even
  40. }
  41. }else{
  42. while(!Obj_BeDeleted(objoption)){
  43. ObjEffect_SetVertexXY(objoption,0,GetPlayerX+optionxpos-7,GetPlayerY+optionypos-7);
  44. ObjEffect_SetVertexXY(objoption,1,GetPlayerX+optionxpos+7,GetPlayerY+optionypos-7);
  45. ObjEffect_SetVertexXY(objoption,2,GetPlayerX+optionxpos+7,GetPlayerY+optionypos+7);
  46. ObjEffect_SetVertexXY(objoption,3,GetPlayerX+optionxpos-7,GetPlayerY+optionypos+7);
  47. yield;
  48. }
  49. }
  50. }
  51.  
  52. @Initialize{
  53. LoadGraphic(Img_Reimu);
  54. LoadPlayerShotData(GetCurrentScriptDirectory()~"Shot.txt");
  55. SetPlayerLifeImage(Img_Reimu, 40, 0, 79, 49);
  56. SetSpeed(4,2);
  57. Option("LEFT");
  58. Option("RIGHT");
  59. }
  60.  
  61. @MainLoop{
  62. if((GetKeyState(VK_SHOT)==KEY_PUSH || GetKeyState(VK_SHOT)==KEY_HOLD) && count==-1){
  63. count = 0;
  64. }
  65. if(GetKeyState(VK_SLOWMOVE)==KEY_PUSH || GetKeyState(VK_SLOWMOVE)==KEY_HOLD){
  66. if(count%6 == 0){
  67.  
  68. }
  69. }else{
  70. if(count%8 == 0){
  71. i = -3;
  72. while(i<=3){
  73. CreatePlayerShot01(GetPlayerX()+3, GetPlayerY(), 10, 180, 2, 2, 1);
  74. CreatePlayerShot01(GetPlayerX()-3, GetPlayerY(), 10, 180, 2, 2, 1);
  75.  
  76. }
  77. }
  78. if(count >= 0){
  79. count++;
  80. }
  81. if(count >= 6 && (GetKeyState(VK_SLOWMOVE)==KEY_PUSH || GetKeyState(VK_SLOWMOVE)==KEY_HOLD)){
  82. count=-1;
  83. }
  84. if(count >= 8){
  85. count=-1;
  86. }
  87. yield;
  88. }
  89. @Missed{
  90. }
  91. @SpellCard{
  92. }
  93. @DrawLoop{
  94. SetTexture(Img_Reimu);
  95. if(GetKeyState(VK_LEFT)==KEY_PUSH || GetKeyState(VK_LEFT)==KEY_HOLD){
  96. SetGraphicRect(80, 0, 119, 49); // left movement frame
  97. }else if(GetKeyState(VK_RIGHT)==KEY_PUSH || GetKeyState(VK_RIGHT)==KEY_HOLD){
  98. SetGraphicRect(0, 0, 39, 49); // right movement frame
  99. }else{
  100. SetGraphicRect(40, 0, 79, 49); // neutral frame
  101. }
  102. DrawGraphic(GetPlayerX(), GetPlayerY());
  103. }
  104. @Finalize
  105. DeleteGraphic(Img_Reimu);
  106. }
  107. }
  108.  
  109. script_spell OrbsofHakurei{
  110. @Initialize{
  111. }
  112. @MainLoop{
  113. }
  114. @Finalize{
  115. }
  116. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement