Nie możesz wybrać więcej, niż 25 tematów Tematy muszą się zaczynać od litery lub cyfry, mogą zawierać myślniki ('-') i mogą mieć do 35 znaków.

78 wiersze
2.7 KiB

  1. /**********************************************************************************************
  2. *
  3. * raylib - Advance Game template
  4. *
  5. * Ending Screen Functions Definitions (Init, Update, Draw, Unload)
  6. *
  7. * Copyright (c) 2014-2021 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. //----------------------------------------------------------------------------------
  28. // Module Variables Definition (local)
  29. //----------------------------------------------------------------------------------
  30. static int framesCounter = 0;
  31. static int finishScreen = 0;
  32. //----------------------------------------------------------------------------------
  33. // Ending Screen Functions Definition
  34. //----------------------------------------------------------------------------------
  35. // Ending Screen Initialization logic
  36. void InitEndingScreen(void)
  37. {
  38. // TODO: Initialize ENDING screen variables here!
  39. framesCounter = 0;
  40. finishScreen = 0;
  41. }
  42. // Ending Screen Update logic
  43. void UpdateEndingScreen(void)
  44. {
  45. // TODO: Update ENDING screen variables here!
  46. // Press enter or tap to return to TITLE screen
  47. if (IsKeyPressed(KEY_ENTER) || IsGestureDetected(GESTURE_TAP))
  48. {
  49. finishScreen = 1;
  50. PlaySound(fxCoin);
  51. }
  52. }
  53. // Ending Screen Draw logic
  54. void DrawEndingScreen(void)
  55. {
  56. // TODO: Draw ENDING screen here!
  57. DrawRectangle(0, 0, GetScreenWidth(), GetScreenHeight(), BLUE);
  58. DrawTextEx(font, "ENDING SCREEN", (Vector2){ 20, 10 }, font.baseSize*3, 4, DARKBLUE);
  59. DrawText("PRESS ENTER or TAP to RETURN to TITLE SCREEN", 120, 220, 20, DARKBLUE);
  60. }
  61. // Ending Screen Unload logic
  62. void UnloadEndingScreen(void)
  63. {
  64. // TODO: Unload ENDING screen variables here!
  65. }
  66. // Ending Screen should finish?
  67. int FinishEndingScreen(void)
  68. {
  69. return finishScreen;
  70. }