Guest User

Difficulty display

a guest
Sep 6th, 2013
111
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.17 KB | None | 0 0
  1. function Difficulty(type){
  2. let csd = GetCurrentScriptDirectory;
  3. let obje=Obj_Create(OBJ_EFFECT);
  4.  
  5. let texture = csd~ ".\include\Difficulty.png";
  6. let left = 0;
  7. let top = 0;
  8. let right = 0;
  9. let bottom = 0;
  10. LoadGraphic(texture);
  11.  
  12. if(type == "Easy"){
  13. top = 0;
  14. right = 68;
  15. bottom = 16.8;
  16. }
  17.  
  18. if(type == "Normal"){
  19. top = 16.8;
  20. right = 68;
  21. bottom = 32;
  22. }
  23.  
  24. if(type == "Hard"){
  25. top = 33.6;
  26. right = 68;
  27. bottom = 50.4;
  28. }
  29.  
  30. let XYbLR = left + right / 2;
  31. let XYbTB = 0;
  32.  
  33.  
  34. if(type == "Easy"){
  35. XYbTB = top + bottom / 2 ;
  36. }
  37.  
  38. if(type == "Normal"){
  39. XYbTB = top / 2 ;
  40. }
  41.  
  42. if(type == "Hard"){
  43. XYbTB = top - bottom / 2 ;
  44. }
  45.  
  46.  
  47.  
  48. Obj_SetPosition(obje,230,40);
  49. ObjEffect_SetTexture(obje,texture);
  50. ObjEffect_SetRenderState(obje,ALPHA);
  51. ObjEffect_SetLayer(obje,8);
  52. ObjEffect_SetScale(obje,1,1);
  53.  
  54. ObjEffect_SetPrimitiveType(obje, PRIMITIVE_TRIANGLESTRIP);
  55. ObjEffect_CreateVertex(obje, 4);
  56. ObjEffect_SetVertexXY(obje, 0, -XYbLR, -XYbTB);
  57. ObjEffect_SetVertexUV(obje, 0, left, top);
  58. ObjEffect_SetVertexXY(obje, 1, XYbLR, -XYbTB);
  59. ObjEffect_SetVertexUV(obje, 1, right, top);
  60. ObjEffect_SetVertexXY(obje, 2, -XYbLR, XYbTB);
  61. ObjEffect_SetVertexUV(obje, 2, left, bottom);
  62. ObjEffect_SetVertexXY(obje, 3, XYbLR, XYbTB);
  63. ObjEffect_SetVertexUV(obje, 3, right, bottom);
  64. DF(obje,texture);
  65.  
  66. return obje;
  67.  
  68. }
  69. task DF(obje,texture){
  70. let csd = GetCurrentScriptDirectory;
  71.  
  72.  
  73. let count3 = 0;
  74. let count = 1;
  75. let count2 = 0;
  76. let count4 = 0;
  77.  
  78. while(!Obj_BeDeleted(obje)){
  79.  
  80. count3++;
  81. count+=2;
  82. count2++;
  83. count4++;
  84. if(count>=60){
  85. ObjEffect_SetAngle(obje,count-5,0,0);
  86. }
  87. if(count>=93){
  88. count = 93;
  89. }
  90. if(count2==94){
  91. Obj_SetPosition(obje,530,40);
  92. }
  93. if(count2>=100){
  94. ObjEffect_SetAngle(obje,count-count,0,0);
  95. count-=4;
  96. }
  97. if(count3==5){
  98. ObjEffect_SetTexture(obje,0);
  99. count3 = -5;
  100. }
  101. if(count3==0){
  102. ObjEffect_SetTexture(obje,texture);
  103. }
  104. if(count4>=20){
  105. count3 = 0;
  106. }
  107.  
  108. yield;
  109. }
  110. }
Advertisement
Add Comment
Please, Sign In to add comment