Advertisement
Guest User

Untitled

a guest
Jun 22nd, 2017
57
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.60 KB | None | 0 0
  1. for(i = 0; i < sprite_width; i++)
  2. {
  3. for(j = 0; j < sprite_height; j++)
  4. {
  5. hitboxtouch = instance_position(x, y, obj_hitbox)
  6. hurttouch = instance_position(x, y, obj_hurtbox)
  7.  
  8. if hitboxtouch != noone and hitboxtouch.maker != self and hurttouch != noone and hurttouch.maker = self
  9. {
  10. hitboxcheck = true;
  11. xx = i;
  12. yy = j;
  13. }
  14.  
  15. hitboxed = hitboxxed
  16.  
  17. if hitboxcheck = true
  18. {
  19. for(k = 0; k < 20; k++)
  20. {
  21. for(l = 0; l < 20; l++)
  22. {
  23. hitbox = instance_position(xx, yy, obj_hitbox)
  24.  
  25. if hitbox = noone
  26. {break;}
  27.  
  28. if hitbox.checked = true or hitbox.maker = self
  29. {
  30. x = hitbox.tempx;
  31. y = hitbox.tempy;
  32. hitbox.x = global.tempx;
  33. hitbox.y = global.tempy;
  34.  
  35. hitbox = noone
  36. }
  37. else
  38. {
  39. for(m = 0; m < 20; m++)
  40. {
  41. hitboxreturn = instance_position(global.tempx, global.tempy, obj_hitbox)
  42.  
  43. if hitboxreturn = noone
  44. {break;}
  45. else
  46. {
  47. hitboxreturn.x = hitboxreturn.tempx;
  48. hitboxreturn.y = hitboxreturn.tempy
  49. }
  50. }
  51.  
  52. break;
  53. }
  54. }
  55.  
  56. if hitbox != noone
  57. {
  58. if k = 0
  59. {hitbox = hitboxed;}
  60.  
  61. if hitbox.priority > hitboxed.priority and k != 0
  62. {hitbox = hitboxed;}
  63.  
  64. hitbox.checked = true;
  65. }
  66. else
  67. {
  68. break;
  69. }
  70. }
  71. }
  72.  
  73. if hitboxed.priority > hitboxxed.priority
  74. {
  75. hitboxxed = hitboxed
  76. }
  77.  
  78. hitboxxed = hitboxed;
  79. hitboxcheck = false;
  80.  
  81. for(n = 0; n < 20; n++)
  82. {
  83. for(o = 0; o < 20; o++)
  84. {
  85. hitbox = instance_position(xx, yy, obj_hitbox)
  86.  
  87. if hitbox = noone
  88. {break;}
  89.  
  90. if hitbox.checked = false or hitbox.maker = self
  91. {
  92. x = hitbox.tempx;
  93. y = hitbox.tempy;
  94. hitbox.x = global.tempx;
  95. hitbox.y = global.tempy;
  96.  
  97. hitbox = noone
  98. }
  99. else
  100. {
  101. for(p = 0; p < 20; p++)
  102. {
  103. hitboxreturn = instance_position(global.tempx, global.tempy, obj_hitbox)
  104.  
  105. if hitboxreturn = noone
  106. {break;}
  107. else
  108. {
  109. hitboxreturn.x = hitboxreturn.tempx;
  110. hitboxreturn.y = hitboxreturn.tempy
  111. }
  112. }
  113.  
  114. break;
  115. }
  116. }
  117.  
  118. if hitbox != noone
  119. {
  120. if k = 0
  121. {hitbox = hitboxed;}
  122.  
  123. if hitbox.priority > hitboxed.priority and k != 0
  124. {hitbox = hitboxed;}
  125.  
  126. hitbox.checked = false;
  127. }
  128. else
  129. {
  130. break;
  131. }
  132. }
  133. }
  134. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement