Advertisement
Benji23245

Untitled

Mar 9th, 2018
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 8.04 KB | None | 0 0
  1. //HUD
  2. if (GameState != 21)
  3. {
  4. if (GetCharacterObject(0))
  5. {
  6. //HudDisplayRingsSTH06(Rings, 3, &hud_sprite);
  7. njDrawSprite2D_Queue(&HUD_SPRITE, HUD_score, -1, NJD_SPRITE_ALPHA, (QueuedModelFlagsB)0);
  8. njDrawSprite2D_Queue(&HUD_SPRITE, HUD_timer, -1, NJD_SPRITE_ALPHA, (QueuedModelFlagsB)0);
  9. njDrawSprite2D_Queue(&HUD_SPRITE, HUD_rings, -1, NJD_SPRITE_ALPHA, (QueuedModelFlagsB)0);
  10. njDrawSprite2D_Queue(&HUD_SPRITE, HUD_lives, -1, NJD_SPRITE_ALPHA, (QueuedModelFlagsB)0);
  11. if (GetCharacterID(0) == Characters_Sonic && MetalSonicFlag == 0)
  12. {
  13. njDrawSprite2D_Queue(&HUD_SPRITE, HUD_gauge, -1, NJD_SPRITE_ALPHA, (QueuedModelFlagsB)0);
  14. njDrawSprite2D_Queue(&HUD_SPRITE, HUD_sonic_life, -1, NJD_SPRITE_ALPHA, (QueuedModelFlagsB)0);
  15. }
  16. else if (GetCharacterID(0) == Characters_Tails) njDrawSprite2D_Queue(&HUD_SPRITE, HUD_tails_life, -1, NJD_SPRITE_ALPHA, (QueuedModelFlagsB)0);
  17. else if (GetCharacterID(0) == Characters_Knuckles) njDrawSprite2D_Queue(&HUD_SPRITE, HUD_knuckles_life, -1, NJD_SPRITE_ALPHA, (QueuedModelFlagsB)0);
  18. else if (GetCharacterID(0) == Characters_Amy) njDrawSprite2D_Queue(&HUD_SPRITE, HUD_amy_life, -1, NJD_SPRITE_ALPHA, (QueuedModelFlagsB)0);
  19. else if (GetCharacterID(0) == Characters_Gamma) njDrawSprite2D_Queue(&HUD_SPRITE, HUD_gamma_life, -1, NJD_SPRITE_ALPHA, (QueuedModelFlagsB)0);
  20. HUD_SPRITE_NUMBERS_RINGS.p.x = 0;
  21. HUD_SPRITE_NUMBERS_RINGS.p.y = 0;
  22. HUD_SPRITE_NUMBERS_RINGS_0_RED.p.x = HUD_SPRITE_NUMBERS_RINGS.p.x;
  23. HUD_SPRITE_NUMBERS_RINGS_0_RED.p.y = HUD_SPRITE_NUMBERS_RINGS.p.y;
  24. HUD_SPRITE_NUMBERS_TIMER_MINUTES.p.x = -34;
  25. HUD_SPRITE_NUMBERS_TIMER_MINUTES.p.y = -65;
  26. HUD_SPRITE_NUMBERS_TIMER_SECONDS.p.x = HUD_SPRITE_NUMBERS_TIMER_MINUTES.p.x + 69;
  27. HUD_SPRITE_NUMBERS_TIMER_SECONDS.p.y = HUD_SPRITE_NUMBERS_TIMER_MINUTES.p.y;
  28. HUD_SPRITE_NUMBERS_TIMER_FRAMES.p.x = HUD_SPRITE_NUMBERS_TIMER_SECONDS.p.x + 71;
  29. HUD_SPRITE_NUMBERS_TIMER_FRAMES.p.y = HUD_SPRITE_NUMBERS_TIMER_MINUTES.p.y;
  30. HUD_SPRITE_NUMBERS_LIVES.p.y = 65;
  31. HUD_SPRITE_NUMBERS_SCORE.p.y = -133;
  32.  
  33. //Ring Counter
  34. if (Rings == 0)
  35. {
  36. njDrawSprite2D_Queue(&HUD_SPRITE_NUMBERS_RINGS_0_RED, 0, -1, NJD_SPRITE_ALPHA, (QueuedModelFlagsB)0);
  37. njDrawSprite2D_Queue(&HUD_SPRITE_NUMBERS_RINGS_0_RED, 1, -1, NJD_SPRITE_ALPHA, (QueuedModelFlagsB)0);
  38. }
  39. else if (Rings > 0 && Rings < 1000)
  40. {
  41. HudDisplayRingsSTH06(Rings, 3, &HUD_SPRITE_NUMBERS_RINGS);
  42. }
  43. else if (Rings >= 1000)
  44. {
  45. HudDisplayRingsSTH06(Rings, 4, &HUD_SPRITE_NUMBERS_RINGS);
  46. }
  47.  
  48. //Ring image animation
  49. //if (GameState == 4)
  50. //{
  51. // OldRingsHUD = Rings;
  52. // can_animate = 0;
  53. //}
  54. //if (GameState == 15 || GameState == 16)
  55. //{
  56. if (GetCharacterObject(0))
  57. {
  58. if (Rings - OldRingsHUD > 0)
  59. {
  60. can_animate_loss = 0;
  61. ++can_animate_gain;
  62. if (can_animate_gain == 1)
  63. {
  64. njDrawSprite2D_Queue(&HUD_SPRITE_NUMBERS_RING_ANIM, 1, -1, NJD_SPRITE_ALPHA, (QueuedModelFlagsB)0);
  65. }
  66. else if (can_animate_gain == 2)
  67. {
  68. njDrawSprite2D_Queue(&HUD_SPRITE_NUMBERS_RING_ANIM, 2, -1, NJD_SPRITE_ALPHA, (QueuedModelFlagsB)0);
  69. }
  70. else if (can_animate_gain == 3)
  71. {
  72. njDrawSprite2D_Queue(&HUD_SPRITE_NUMBERS_RING_ANIM, 3, -1, NJD_SPRITE_ALPHA, (QueuedModelFlagsB)0);
  73. }
  74. else if (can_animate_gain == 4)
  75. {
  76. njDrawSprite2D_Queue(&HUD_SPRITE_NUMBERS_RING_ANIM, 4, -1, NJD_SPRITE_ALPHA, (QueuedModelFlagsB)0);
  77. }
  78. else if (can_animate_gain == 5)
  79. {
  80. njDrawSprite2D_Queue(&HUD_SPRITE_NUMBERS_RING_ANIM, 5, -1, NJD_SPRITE_ALPHA, (QueuedModelFlagsB)0);
  81. }
  82. else if (can_animate_gain == 6)
  83. {
  84. njDrawSprite2D_Queue(&HUD_SPRITE_NUMBERS_RING_ANIM, 6, -1, NJD_SPRITE_ALPHA, (QueuedModelFlagsB)0);
  85. }
  86. else if (can_animate_gain == 7)
  87. {
  88. njDrawSprite2D_Queue(&HUD_SPRITE_NUMBERS_RING_ANIM, 7, -1, NJD_SPRITE_ALPHA, (QueuedModelFlagsB)0);
  89. OldRingsHUD = Rings;
  90. can_animate_gain = 0;
  91. }
  92. }
  93. else if (Rings - OldRingsHUD < 0)
  94. {
  95. can_animate_gain = 0;
  96. ++can_animate_loss;
  97. if (can_animate_loss == 1)
  98. {
  99. njDrawSprite2D_Queue(&HUD_SPRITE_NUMBERS_RING_ANIM, 7, -1, NJD_SPRITE_ALPHA, (QueuedModelFlagsB)0);
  100. }
  101. else if (can_animate_loss == 2)
  102. {
  103. njDrawSprite2D_Queue(&HUD_SPRITE_NUMBERS_RING_ANIM, 6, -1, NJD_SPRITE_ALPHA, (QueuedModelFlagsB)0);
  104. }
  105. else if (can_animate_loss == 3)
  106. {
  107. njDrawSprite2D_Queue(&HUD_SPRITE_NUMBERS_RING_ANIM, 5, -1, NJD_SPRITE_ALPHA, (QueuedModelFlagsB)0);
  108. }
  109. else if (can_animate_loss == 4)
  110. {
  111. njDrawSprite2D_Queue(&HUD_SPRITE_NUMBERS_RING_ANIM, 4, -1, NJD_SPRITE_ALPHA, (QueuedModelFlagsB)0);
  112. }
  113. else if (can_animate_loss == 5)
  114. {
  115. njDrawSprite2D_Queue(&HUD_SPRITE_NUMBERS_RING_ANIM, 3, -1, NJD_SPRITE_ALPHA, (QueuedModelFlagsB)0);
  116. }
  117. else if (can_animate_loss == 6)
  118. {
  119. njDrawSprite2D_Queue(&HUD_SPRITE_NUMBERS_RING_ANIM, 2, -1, NJD_SPRITE_ALPHA, (QueuedModelFlagsB)0);
  120. }
  121. else if (can_animate_loss == 7)
  122. {
  123. njDrawSprite2D_Queue(&HUD_SPRITE_NUMBERS_RING_ANIM, 1, -1, NJD_SPRITE_ALPHA, (QueuedModelFlagsB)0);
  124. OldRingsHUD = Rings;
  125. can_animate_loss = 0;
  126. }
  127. }
  128. else if (OldRingsHUD == Rings)
  129. {
  130. njDrawSprite2D_Queue(&HUD_SPRITE_NUMBERS_RING_ANIM, 0, -1, NJD_SPRITE_ALPHA, (QueuedModelFlagsB)0);
  131. }
  132. }
  133. //}
  134.  
  135. //Lives Counter
  136. if (Lives < 10)
  137. {
  138. HUD_SPRITE_NUMBERS_LIVES.p.x = 48.8;
  139. HudDisplayLivesSTH06(Lives, 1, &HUD_SPRITE_NUMBERS_LIVES);
  140. }
  141. else if (Lives >= 10)
  142. {
  143. HUD_SPRITE_NUMBERS_LIVES.p.x = 25.4;
  144. HudDisplayLivesSTH06(Lives, 2, &HUD_SPRITE_NUMBERS_LIVES);
  145. }
  146.  
  147. //Timer Minutes
  148. HudDisplayMinutesSTH06(TimeMinutes, 2, &HUD_SPRITE_NUMBERS_TIMER_MINUTES);
  149.  
  150. //Timer Minutes
  151. HudDisplaySecondsSTH06(TimeSeconds, 2, &HUD_SPRITE_NUMBERS_TIMER_SECONDS);
  152.  
  153. //Score Counter
  154. HudDisplayFramesSTH06(TimeFrames, 3, &HUD_SPRITE_NUMBERS_TIMER_FRAMES);
  155. if (EnemyBonus < 10)
  156. {
  157. HUD_SPRITE_NUMBERS_SCORE.p.x = 153;
  158. HudDisplayScoreSTH06(EnemyBonus, 1, &HUD_SPRITE_NUMBERS_SCORE);
  159. }
  160. else if (EnemyBonus >= 10 && EnemyBonus < 100)
  161. {
  162. HUD_SPRITE_NUMBERS_SCORE.p.x = 129.6;
  163. HudDisplayScoreSTH06(EnemyBonus, 2, &HUD_SPRITE_NUMBERS_SCORE);
  164. }
  165. else if (EnemyBonus >= 100 && EnemyBonus < 1000)
  166. {
  167. HUD_SPRITE_NUMBERS_SCORE.p.x = 106.2;
  168. HudDisplayScoreSTH06(EnemyBonus, 3, &HUD_SPRITE_NUMBERS_SCORE);
  169. }
  170. else if (EnemyBonus >= 1000 && EnemyBonus < 10000)
  171. {
  172. HUD_SPRITE_NUMBERS_SCORE.p.x = 82.8;
  173. HudDisplayScoreSTH06(EnemyBonus, 4, &HUD_SPRITE_NUMBERS_SCORE);
  174. }
  175. else if (EnemyBonus >= 10000 && EnemyBonus < 100000)
  176. {
  177. HUD_SPRITE_NUMBERS_SCORE.p.x = 59.4;
  178. HudDisplayScoreSTH06(EnemyBonus, 5, &HUD_SPRITE_NUMBERS_SCORE);
  179. }
  180. else if (EnemyBonus >= 100000 && EnemyBonus < 1000000)
  181. {
  182. HUD_SPRITE_NUMBERS_SCORE.p.x = 36;
  183. HudDisplayScoreSTH06(EnemyBonus, 6, &HUD_SPRITE_NUMBERS_SCORE);
  184. }
  185. else if (EnemyBonus >= 1000000 && EnemyBonus < 10000000)
  186. {
  187. HUD_SPRITE_NUMBERS_SCORE.p.x = 12.6;
  188. HudDisplayScoreSTH06(EnemyBonus, 7, &HUD_SPRITE_NUMBERS_SCORE);
  189. }
  190. else if (EnemyBonus >= 10000000 && EnemyBonus < 100000000)
  191. {
  192. HUD_SPRITE_NUMBERS_SCORE.p.x = -10.8;
  193. HudDisplayScoreSTH06(EnemyBonus, 8, &HUD_SPRITE_NUMBERS_SCORE);
  194. }
  195. else
  196. {
  197. HUD_SPRITE_NUMBERS_SCORE.p.x = -34.2;
  198. HudDisplayScoreSTH06(EnemyBonus, 9, &HUD_SPRITE_NUMBERS_SCORE);
  199. }
  200. }
  201. }
  202.  
  203. //Character Select HUD
  204. if (GameState == 21)
  205. {
  206. if (GetCharacterObject(0))
  207. {
  208. LoadPVM("HUD", &HUD_TEXLIST);// do better loading (not have it repeat)
  209. //njDrawSprite2D_Queue(&HUD_SPRITE2, char_sel_sonic, -1, NJD_SPRITE_ALPHA, (QueuedModelFlagsB)0);
  210. }
  211. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement