您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

529 行
23 KiB

  1. /**********************************************************************************************
  2. *
  3. * raylib - Koala Seasons game
  4. *
  5. * Ending Screen Functions Definitions (Init, Update, Draw, Unload)
  6. *
  7. * Copyright (c) 2014-2016 Ramon Santamaria (@raysan5)
  8. *
  9. * This software is provided "as-is", without any express or implied warranty. In no event
  10. * will the authors be held liable for any damages arising from the use of this software.
  11. *
  12. * Permission is granted to anyone to use this software for any purpose, including commercial
  13. * applications, and to alter it and redistribute it freely, subject to the following restrictions:
  14. *
  15. * 1. The origin of this software must not be misrepresented; you must not claim that you
  16. * wrote the original software. If you use this software in a product, an acknowledgment
  17. * in the product documentation would be appreciated but is not required.
  18. *
  19. * 2. Altered source versions must be plainly marked as such, and must not be misrepresented
  20. * as being the original software.
  21. *
  22. * 3. This notice may not be removed or altered from any source distribution.
  23. *
  24. **********************************************************************************************/
  25. #include "raylib.h"
  26. #include "screens.h"
  27. #include <stdio.h>
  28. #include "atlas01.h"
  29. #include "atlas02.h"
  30. typedef enum { DELAY, SEASONS, LEAVES, KILLS, REPLAY } EndingCounter;
  31. typedef struct {
  32. Vector2 position;
  33. Vector2 speed;
  34. float rotation;
  35. float size;
  36. Color color;
  37. float alpha;
  38. bool active;
  39. } Particle;
  40. //----------------------------------------------------------------------------------
  41. // Global Variables Definition (local to this module)
  42. //----------------------------------------------------------------------------------
  43. // Ending screen global variables
  44. static EndingCounter endingCounter;
  45. static int framesCounter;
  46. static int finishScreen;
  47. static int framesKillsCounter;
  48. static Rectangle playButton;
  49. static Rectangle shopButton;
  50. static Rectangle trophyButton;
  51. static Rectangle shareButton;
  52. static Color buttonPlayColor;
  53. static Color buttonShopColor;
  54. static Color buttonTrophyColor;
  55. static Color buttonShareColor;
  56. static Color backgroundColor;
  57. static int currentScore;
  58. static int seasonsCounter;
  59. static int currentLeavesEnding;
  60. static int finalYears;
  61. static int replayTimer;
  62. static int yearsElapsed;
  63. static int initRotation;
  64. static float clockRotation;
  65. static float finalRotation;
  66. static bool replaying;
  67. static bool active[MAX_KILLS];
  68. static char initMonthText[32];
  69. static char finalMonthText[32];
  70. static Particle leafParticles[20];
  71. static int drawTimer;
  72. // Death texts
  73. const char textOwl01[32] = "Turned into a pretty";
  74. const char textOwl02[32] = "owl pellet";
  75. const char textDingo01[32] = "A dingo took your life";
  76. const char textFire01[32] = "Kissed by fire";
  77. const char textSnake01[32] = "Digested alive by a";
  78. const char textSnake02[32] = "big snake";
  79. const char textNaturalDeath01[32] = "LIFE KILLED YOU";
  80. const char textBee01[32] = "You turn out to be";
  81. const char textBee02[32] = "allergic to bee sting";
  82. const char textEagle[32] = "KOALA IS DEAD :(";
  83. static float LinearEaseIn(float t, float b, float c, float d) { return c*t/d + b; }
  84. //----------------------------------------------------------------------------------
  85. // Ending Screen Functions Definition
  86. //----------------------------------------------------------------------------------
  87. // Ending Screen Initialization logic
  88. void InitEndingScreen(void)
  89. {
  90. framesCounter = -10;
  91. finishScreen = 0;
  92. drawTimer = 15;
  93. replayTimer = 0;
  94. replaying = false;
  95. finalYears = initYears + (seasons/4);
  96. yearsElapsed = seasons/4;
  97. playButton = (Rectangle){ GetScreenWidth()*0.871, GetScreenHeight()*0.096, 123, 123};
  98. shopButton = (Rectangle){ GetScreenWidth()*0.871, GetScreenHeight()*0.303, 123, 123};
  99. trophyButton = (Rectangle){ GetScreenWidth()*0.871, GetScreenHeight()*0.513, 123, 123};
  100. shareButton = (Rectangle){ GetScreenWidth()*0.871, GetScreenHeight()*0.719, 123, 123};
  101. buttonPlayColor = WHITE;
  102. buttonShopColor = WHITE;
  103. buttonTrophyColor = WHITE;
  104. buttonShareColor = WHITE;
  105. currentScore = 0;
  106. seasonsCounter = 0;
  107. currentLeavesEnding = 0;
  108. endingCounter = DELAY;
  109. backgroundColor = (Color){ 176, 167, 151, 255};
  110. for (int j = 0; j < 20; j++)
  111. {
  112. leafParticles[j].active = false;
  113. leafParticles[j].position = (Vector2){ GetRandomValue(-20, 20), GetRandomValue(-20, 20) };
  114. leafParticles[j].speed = (Vector2){ (float)GetRandomValue(-500, 500)/100, (float)GetRandomValue(-500, 500)/100 };
  115. leafParticles[j].size = (float)GetRandomValue(3, 10)/5;
  116. leafParticles[j].rotation = GetRandomValue(0, 360);
  117. leafParticles[j].color = WHITE;
  118. leafParticles[j].alpha = 1;
  119. }
  120. // Seasons death texts
  121. if (initSeason == 0)
  122. {
  123. sprintf(initMonthText, "SUMMER");
  124. clockRotation = 225;
  125. initRotation = 225;
  126. }
  127. else if (initSeason == 1)
  128. {
  129. sprintf(initMonthText, "AUTUMN");
  130. clockRotation = 135;
  131. initRotation = 135;
  132. }
  133. else if (initSeason == 2)
  134. {
  135. sprintf(initMonthText, "WINTER");
  136. clockRotation = 45;
  137. initRotation = 45;
  138. }
  139. else if (initSeason == 3)
  140. {
  141. sprintf(initMonthText, "SPRING");
  142. clockRotation = 315;
  143. initRotation = 315;
  144. }
  145. if (currentSeason == 0)
  146. {
  147. sprintf(finalMonthText, "SUMMER");
  148. finalRotation = 225 + 360*yearsElapsed;
  149. }
  150. else if (currentSeason == 1)
  151. {
  152. sprintf(finalMonthText, "AUTUMN");
  153. finalRotation = 135 + 360*yearsElapsed;
  154. }
  155. else if (currentSeason == 2)
  156. {
  157. sprintf(finalMonthText, "WINTER");
  158. finalRotation = 45 + 360*yearsElapsed;
  159. }
  160. else if (currentSeason == 3)
  161. {
  162. sprintf(finalMonthText, "SPRING");
  163. finalRotation = 315 + 360*yearsElapsed;
  164. }
  165. for (int i = 0; i < MAX_KILLS; i++) active[i] = false;
  166. }
  167. // Ending Screen Update logic
  168. void UpdateEndingScreen(void)
  169. {
  170. framesCounter += 1*TIME_FACTOR;
  171. switch (endingCounter)
  172. {
  173. case DELAY:
  174. {
  175. if(framesCounter >= 10)
  176. {
  177. endingCounter = SEASONS;
  178. framesCounter = 0;
  179. }
  180. } break;
  181. case SEASONS:
  182. {
  183. if (seasons > 0)
  184. {
  185. seasonsCounter = (int)LinearEaseIn((float)framesCounter, 0.0f, (float)(seasons), 90.0f);
  186. clockRotation = LinearEaseIn((float)framesCounter, (float)initRotation, (float)-(finalRotation - initRotation), 90.0f);
  187. if (framesCounter >= 90)
  188. {
  189. endingCounter = LEAVES;
  190. framesCounter = 0;
  191. }
  192. }
  193. else endingCounter = LEAVES;
  194. #if (defined(PLATFORM_ANDROID) || defined(PLATFORM_WEB))
  195. if (IsGestureDetected(GESTURE_TAP))
  196. {
  197. seasonsCounter = seasons;
  198. clockRotation = finalRotation;
  199. framesCounter = 0;
  200. endingCounter = LEAVES;
  201. }
  202. #elif (defined(PLATFORM_DESKTOP) || defined(PLATFORM_WEB))
  203. if (IsKeyPressed(KEY_ENTER))
  204. {
  205. seasonsCounter = seasons;
  206. clockRotation = finalRotation;
  207. framesCounter = 0;
  208. endingCounter = LEAVES;
  209. }
  210. #endif
  211. } break;
  212. case LEAVES:
  213. {
  214. if (currentLeaves > 0)
  215. {
  216. if (currentLeavesEnding == currentLeaves)
  217. {
  218. endingCounter = KILLS;
  219. framesCounter = 0;
  220. }
  221. else if (currentLeavesEnding < currentLeaves)
  222. {
  223. if (framesCounter >= 4)
  224. {
  225. currentLeavesEnding += 1;
  226. framesCounter = 0;
  227. }
  228. for (int i = 0; i < 20; i++)
  229. {
  230. if (!leafParticles[i].active)
  231. {
  232. leafParticles[i].position = (Vector2){ GetScreenWidth()*0.46, GetScreenHeight()*0.32};
  233. leafParticles[i].alpha = 1.0f;
  234. leafParticles[i].active = true;
  235. }
  236. }
  237. }
  238. }
  239. else endingCounter = KILLS;
  240. #if (defined(PLATFORM_ANDROID) || defined(PLATFORM_WEB))
  241. if (IsGestureDetected(GESTURE_TAP))
  242. {
  243. currentLeavesEnding = currentLeaves;
  244. framesCounter = 0;
  245. endingCounter = KILLS;
  246. }
  247. #elif (defined(PLATFORM_DESKTOP) || defined(PLATFORM_WEB))
  248. if (IsKeyPressed(KEY_ENTER))
  249. {
  250. currentLeavesEnding = currentLeaves;
  251. framesCounter = 0;
  252. endingCounter = KILLS;
  253. }
  254. #endif
  255. } break;
  256. case KILLS:
  257. {
  258. if (score > 0)
  259. {
  260. if (framesCounter <= 90 && !replaying)
  261. {
  262. currentScore = (int)LinearEaseIn((float)framesCounter, 0.0f, (float)(score), 90.0f);
  263. }
  264. framesKillsCounter += 1*TIME_FACTOR;
  265. for (int i = 0; i < MAX_KILLS; i++)
  266. {
  267. if (framesKillsCounter >= drawTimer && active[i] == false)
  268. {
  269. active[i] = true;
  270. framesKillsCounter = 0;
  271. }
  272. }
  273. if (framesCounter >= 90)
  274. {
  275. endingCounter = REPLAY;
  276. framesCounter = 0;
  277. }
  278. }
  279. else endingCounter = REPLAY;
  280. #if (defined(PLATFORM_ANDROID) || defined(PLATFORM_WEB))
  281. if (IsGestureDetected(GESTURE_TAP))
  282. {
  283. currentScore = score;
  284. framesCounter = 0;
  285. for (int i = 0; i < MAX_KILLS; i++) active[i] = true;
  286. endingCounter = REPLAY;
  287. }
  288. #elif (defined(PLATFORM_DESKTOP) || defined(PLATFORM_WEB))
  289. if (IsKeyPressed(KEY_ENTER))
  290. {
  291. currentScore = score;
  292. framesCounter = 0;
  293. for (int i = 0; i < MAX_KILLS; i++) active[i] = true;
  294. endingCounter = REPLAY;
  295. }
  296. #endif
  297. } break;
  298. case REPLAY:
  299. {
  300. #if (defined(PLATFORM_ANDROID) || defined(PLATFORM_WEB))
  301. if (IsGestureDetected(GESTURE_TAP)) replaying = true;
  302. #elif (defined(PLATFORM_DESKTOP) || defined(PLATFORM_WEB))
  303. if (IsKeyPressed(KEY_ENTER)) replaying = true;
  304. #endif
  305. if (replaying)
  306. {
  307. replayTimer += 1*TIME_FACTOR;
  308. if (replayTimer >= 30)
  309. {
  310. finishScreen = 1;
  311. initSeason = GetRandomValue(0, 3);
  312. }
  313. buttonPlayColor = GOLD;
  314. }
  315. } break;
  316. }
  317. for (int i = 0; i < 20; i++)
  318. {
  319. if (leafParticles[i].active == true)
  320. {
  321. leafParticles[i].position.x += leafParticles[i].speed.x;
  322. leafParticles[i].position.y += leafParticles[i].speed.y;
  323. leafParticles[i].rotation += 6;
  324. leafParticles[i].alpha -= 0.03f;
  325. leafParticles[i].size -= 0.004;
  326. if (leafParticles[i].size <= 0) leafParticles[i].size = 0.0f;
  327. if (leafParticles[i].alpha <= 0)
  328. {
  329. leafParticles[i].alpha = 0.0f;
  330. leafParticles[i].active = false;
  331. }
  332. }
  333. }
  334. // Buttons logic
  335. #if (defined(PLATFORM_ANDROID) || defined(PLATFORM_WEB))
  336. if ((IsGestureDetected(GESTURE_TAP)) && CheckCollisionPointRec(GetTouchPosition(0), playButton))
  337. {
  338. endingCounter = REPLAY;
  339. replaying = true;
  340. }
  341. #elif (defined(PLATFORM_DESKTOP) || defined(PLATFORM_WEB))
  342. if (CheckCollisionPointRec(GetMousePosition(), playButton))
  343. {
  344. buttonPlayColor = GOLD;
  345. if (IsMouseButtonPressed(0))
  346. {
  347. endingCounter = REPLAY;
  348. replaying = true;
  349. }
  350. }
  351. else buttonPlayColor = WHITE;
  352. if (CheckCollisionPointRec(GetMousePosition(), shopButton)) buttonShopColor = GOLD;
  353. else buttonShopColor = WHITE;
  354. if (CheckCollisionPointRec(GetMousePosition(), trophyButton)) buttonTrophyColor = GOLD;
  355. else buttonTrophyColor = WHITE;
  356. if (CheckCollisionPointRec(GetMousePosition(), shareButton)) buttonShareColor = GOLD;
  357. else buttonShareColor = WHITE;
  358. #endif
  359. }
  360. // Ending Screen Draw logic
  361. void DrawEndingScreen(void)
  362. {
  363. for (int x = 0; x < 15; x++)
  364. {
  365. DrawTextureRec(atlas02, ending_background, (Vector2){ending_background.width*(x%5), ending_background.height*(x/5)}, backgroundColor);
  366. }
  367. // Frames and backgrounds
  368. DrawTexturePro(atlas01, ending_plate_frame, (Rectangle){GetScreenWidth()*0.042, GetScreenHeight()*0.606, ending_plate_frame.width, ending_plate_frame.height}, (Vector2){ 0, 0}, 0, WHITE);
  369. DrawTexturePro(atlas01, ending_paint_back, (Rectangle){GetScreenWidth()*0.133, GetScreenHeight()*0.097, ending_paint_back.width, ending_paint_back.height}, (Vector2){ 0, 0}, 0, WHITE);
  370. if (killer == 0) DrawTexturePro(atlas01, ending_paint_koalafire, (Rectangle){GetScreenWidth()*0.145, GetScreenHeight()*0.171, ending_paint_koalafire.width, ending_paint_koalafire.height}, (Vector2){ 0, 0}, 0, WHITE);
  371. else if (killer == 1) DrawTexturePro(atlas01, ending_paint_koalasnake, (Rectangle){GetScreenWidth()*0.145, GetScreenHeight()*0.171, ending_paint_koalasnake.width, ending_paint_koalasnake.height}, (Vector2){ 0, 0}, 0, WHITE);
  372. else if (killer == 2) DrawTexturePro(atlas01, ending_paint_koaladingo, (Rectangle){GetScreenWidth()*0.145, GetScreenHeight()*0.171, ending_paint_koaladingo.width, ending_paint_koaladingo.height}, (Vector2){ 0, 0}, 0, WHITE);
  373. else if (killer == 3) DrawTexturePro(atlas01, ending_paint_koalaowl, (Rectangle){GetScreenWidth()*0.2, GetScreenHeight()*0.3, ending_paint_koalaowl.width, ending_paint_koalaowl.height}, (Vector2){ 0, 0}, 0, WHITE);
  374. else if (killer == 4) DrawTexturePro(atlas01, ending_paint_koalageneric, (Rectangle){GetScreenWidth()*0.133, GetScreenHeight()*0.171, ending_paint_koalageneric.width, ending_paint_koalageneric.height}, (Vector2){ 0, 0}, 0, WHITE);
  375. else if (killer == 5) DrawTexturePro(atlas01, ending_paint_koalabee, (Rectangle){GetScreenWidth()*0.145, GetScreenHeight()*0.171, ending_paint_koalabee.width, ending_paint_koalabee.height}, (Vector2){ 0, 0}, 0, WHITE);
  376. else if (killer == 6) DrawTexturePro(atlas01, ending_paint_koalaeagle, (Rectangle){GetScreenWidth()*0.145, GetScreenHeight()*0.171, ending_paint_koalaeagle.width, ending_paint_koalaeagle.height}, (Vector2){ 0, 0}, 0, WHITE);
  377. DrawTexturePro(atlas01, ending_paint_frame, (Rectangle){GetScreenWidth()*0.102, GetScreenHeight()*0.035, ending_paint_frame.width, ending_paint_frame.height}, (Vector2){ 0, 0}, 0, WHITE);
  378. // UI Score planks
  379. DrawTexturePro(atlas01, ending_score_planksmall, (Rectangle){GetScreenWidth()*0.521, GetScreenHeight()*0.163, ending_score_planksmall.width, ending_score_planksmall.height}, (Vector2){ 0, 0}, 0, WHITE);
  380. DrawTexturePro(atlas01, ending_score_planklarge, (Rectangle){GetScreenWidth()*0.415, GetScreenHeight()*0.303, ending_score_planklarge.width, ending_score_planklarge.height}, (Vector2){ 0, 0}, 0, WHITE);
  381. DrawTexturePro(atlas01, ending_score_planksmall, (Rectangle){GetScreenWidth()*0.521, GetScreenHeight()*0.440, ending_score_planksmall.width, ending_score_planksmall.height}, (Vector2){ 0, 0}, 0, WHITE);
  382. // UI Score icons and frames
  383. DrawTexturePro(atlas01, ending_score_seasonicon, (Rectangle){GetScreenWidth()*0.529, GetScreenHeight()*0.096, ending_score_seasonicon.width, ending_score_seasonicon.height}, (Vector2){ 0, 0}, 0, WHITE);
  384. DrawTexturePro(atlas01, ending_score_seasonneedle, (Rectangle){GetScreenWidth()*0.579, GetScreenHeight()*0.189, ending_score_seasonneedle.width, ending_score_seasonneedle.height}, (Vector2){ending_score_seasonneedle.width/2, ending_score_seasonneedle.height*0.9}, clockRotation, WHITE);
  385. DrawTexturePro(atlas01, ending_score_frame, (Rectangle){GetScreenWidth()*0.535, GetScreenHeight()*0.11, ending_score_frame.width, ending_score_frame.height}, (Vector2){ 0, 0}, 0, WHITE);
  386. DrawTexturePro(atlas01, ending_score_frameback, (Rectangle){GetScreenWidth()*0.430, GetScreenHeight()*0.246, ending_score_frameback.width, ending_score_frameback.height}, (Vector2){ 0, 0}, 0, WHITE);
  387. DrawTexturePro(atlas01, ending_score_frame, (Rectangle){GetScreenWidth()*0.429, GetScreenHeight()*0.244, ending_score_frame.width, ending_score_frame.height}, (Vector2){ 0, 0}, 0, WHITE);
  388. for (int i = 0; i < 20; i++)
  389. {
  390. if (leafParticles[i].active)
  391. {
  392. DrawTexturePro(atlas01, particle_ecualyptusleaf,
  393. (Rectangle){ leafParticles[i].position.x, leafParticles[i].position.y, particle_ecualyptusleaf.width*leafParticles[i].size, particle_ecualyptusleaf.height*leafParticles[i].size },
  394. (Vector2){ particle_ecualyptusleaf.width/2*leafParticles[i].size, particle_ecualyptusleaf.height/2*leafParticles[i].size }, leafParticles[i].rotation, Fade(WHITE,leafParticles[i].alpha));
  395. }
  396. }
  397. DrawTexturePro(atlas01, ending_score_leavesicon, (Rectangle){GetScreenWidth()*0.421, GetScreenHeight()*0.228, ending_score_leavesicon.width, ending_score_leavesicon.height}, (Vector2){ 0, 0}, 0, WHITE);
  398. DrawTexturePro(atlas01, ending_score_frameback, (Rectangle){GetScreenWidth()*0.536, GetScreenHeight()*0.383, ending_score_frameback.width, ending_score_frameback.height}, (Vector2){ 0, 0}, 0, WHITE);
  399. DrawTexturePro(atlas01, ending_score_frame, (Rectangle){GetScreenWidth()*0.535, GetScreenHeight()*0.383, ending_score_frame.width, ending_score_frame.height}, (Vector2){ 0, 0}, 0, WHITE);
  400. DrawTexturePro(atlas01, ending_score_enemyicon, (Rectangle){GetScreenWidth()*0.538, GetScreenHeight()*0.414, ending_score_enemyicon.width, ending_score_enemyicon.height}, (Vector2){ 0, 0}, 0, WHITE);
  401. // UI Buttons
  402. DrawTexturePro(atlas01, ending_button_replay, (Rectangle){GetScreenWidth()*0.871, GetScreenHeight()*0.096, ending_button_replay.width, ending_button_replay.height}, (Vector2){ 0, 0}, 0, buttonPlayColor);
  403. DrawTexturePro(atlas01, ending_button_shop, (Rectangle){GetScreenWidth()*0.871, GetScreenHeight()*0.303, ending_button_shop.width, ending_button_shop.height}, (Vector2){ 0, 0}, 0, buttonShopColor);
  404. DrawTexturePro(atlas01, ending_button_trophy, (Rectangle){GetScreenWidth()*0.871, GetScreenHeight()*0.513, ending_button_trophy.width, ending_button_trophy.height}, (Vector2){ 0, 0}, 0, buttonTrophyColor);
  405. DrawTexturePro(atlas01, ending_button_share, (Rectangle){GetScreenWidth()*0.871, GetScreenHeight()*0.719, ending_button_share.width, ending_button_share.height}, (Vector2){ 0, 0}, 0, buttonShareColor);
  406. DrawTextEx(font, FormatText("%03i", seasonsCounter), (Vector2){ GetScreenWidth()*0.73f, GetScreenHeight()*0.14f }, font.baseSize, 1, WHITE);
  407. DrawTextEx(font, FormatText("%03i", currentLeavesEnding), (Vector2){ GetScreenWidth()*0.73f, GetScreenHeight()*0.29f }, font.baseSize, 1, WHITE);
  408. DrawTextEx(font, FormatText("%04i", currentScore), (Vector2){ GetScreenWidth()*0.715f, GetScreenHeight()*0.426f }, font.baseSize, 1, WHITE);
  409. DrawTextEx(font, FormatText("%s %i - %s %i", initMonthText, initYears, finalMonthText, finalYears), (Vector2){ GetScreenWidth()*0.1f, GetScreenHeight()*0.7f }, font.baseSize/2.0f, 1, WHITE);
  410. for (int i = 0; i < MAX_KILLS; i++)
  411. {
  412. if (active[i])
  413. {
  414. switch (killHistory[i])
  415. {
  416. case 1: DrawTextureRec(atlas01, ending_plate_headsnake, (Vector2){GetScreenWidth()*0.448 + ending_plate_headsnake.width*(i%10), GetScreenHeight()*0.682 + (GetScreenHeight()*0.055)*(i/10)}, WHITE); break;
  417. case 2: DrawTextureRec(atlas01, ending_plate_headdingo, (Vector2){GetScreenWidth()*0.448 + ending_plate_headdingo.width*(i%10), GetScreenHeight()*0.682 + (GetScreenHeight()*0.055)*(i/10)}, WHITE); break;
  418. case 3: DrawTextureRec(atlas01, ending_plate_headowl, (Vector2){GetScreenWidth()*0.448 + ending_plate_headowl.width*(i%10), GetScreenHeight()*0.682 + (GetScreenHeight()*0.055)*(i/10)}, WHITE); break;
  419. case 4: DrawTextureRec(atlas01, ending_plate_headbee, (Vector2){GetScreenWidth()*0.448 + ending_plate_headbee.width*(i%10), GetScreenHeight()*0.682 + (GetScreenHeight()*0.055)*(i/10)}, WHITE); break;
  420. case 5: DrawTextureRec(atlas01, ending_plate_headeagle, (Vector2){GetScreenWidth()*0.448 + ending_plate_headeagle.width*(i%10), GetScreenHeight()*0.682 + (GetScreenHeight()*0.055)*(i/10)}, WHITE); break;
  421. default: break;
  422. }
  423. }
  424. }
  425. /*
  426. DrawText(FormatText("KOALA IS DEAD :("), GetScreenWidth()/2 - MeasureText("YOU'RE DEAD ", 60)/2, GetScreenHeight()/3, 60, RED);
  427. DrawText(FormatText("Score: %02i - HiScore: %02i", score, hiscore),GetScreenWidth()/2 - MeasureText("Score: 00 - HiScore: 00", 60)/2, GetScreenHeight()/3 +100, 60, RED);
  428. DrawText(FormatText("You lived: %02i years", years),GetScreenWidth()/2 - MeasureText("You lived: 00", 60)/2 + 60, GetScreenHeight()/3 +200, 30, RED);
  429. DrawText(FormatText("%02s killed you", killer),GetScreenWidth()/2 - MeasureText("killer killed you", 60)/2 + 90, GetScreenHeight()/3 +270, 30, RED);
  430. //DrawRectangle(0, 0, GetScreenWidth(), GetScreenHeight(), Fade(BLACK, 0.5));
  431. */
  432. //DrawTextEx(font, FormatText("%02s", killer), (Vector2){ GetScreenWidth()*0.08, GetScreenHeight()*0.78 }, font.baseSize/2, 1, WHITE);
  433. if (killer == 0) DrawTextEx(font, textFire01, (Vector2){ GetScreenWidth()*0.13f, GetScreenHeight()*0.78f }, font.baseSize/2.0f, 1, WHITE);
  434. else if (killer == 2) DrawTextEx(font, textDingo01, (Vector2){ GetScreenWidth()*0.13f, GetScreenHeight()*0.78f }, font.baseSize/2.0f, 1, WHITE);
  435. else if (killer == 1)
  436. {
  437. DrawTextEx(font, textSnake01, (Vector2){ GetScreenWidth()*0.13f, GetScreenHeight()*0.78f }, font.baseSize/2.0f, 1, WHITE);
  438. DrawTextEx(font, textSnake02, (Vector2){ GetScreenWidth()*0.13f, GetScreenHeight()*0.83f }, font.baseSize/2.0f, 1, WHITE);
  439. }
  440. else if (killer == 3)
  441. {
  442. DrawTextEx(font, textOwl01, (Vector2){ GetScreenWidth()*0.13f, GetScreenHeight()*0.78f }, font.baseSize/2.0f, 1, WHITE);
  443. DrawTextEx(font, textOwl02, (Vector2){ GetScreenWidth()*0.13f, GetScreenHeight()*0.83f }, font.baseSize/2.0f, 1, WHITE);
  444. }
  445. else if (killer == 4) DrawTextEx(font, textNaturalDeath01, (Vector2){ GetScreenWidth()*0.13f, GetScreenHeight()*0.78f }, font.baseSize/2.0f, 1, WHITE);
  446. else if (killer == 5)
  447. {
  448. DrawTextEx(font, textBee01, (Vector2){ GetScreenWidth()*0.13f, GetScreenHeight()*0.78f }, font.baseSize/2.0f, 1, WHITE);
  449. DrawTextEx(font, textBee02, (Vector2){ GetScreenWidth()*0.13f, GetScreenHeight()*0.83f }, font.baseSize/2.0f, 1, WHITE);
  450. }
  451. else if (killer == 6) DrawTextEx(font, textEagle, (Vector2){ GetScreenWidth()*0.13f, GetScreenHeight()*0.78f }, font.baseSize/2.0f, 1, WHITE);
  452. }
  453. // Ending Screen Unload logic
  454. void UnloadEndingScreen(void)
  455. {
  456. // ...
  457. }
  458. // Ending Screen should finish?
  459. int FinishEndingScreen(void)
  460. {
  461. return finishScreen;
  462. }