Não pode escolher mais do que 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.

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