You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

124 lines
4.2 KiB

  1. /**********************************************************************************************
  2. *
  3. * raylib - Koala Seasons game
  4. *
  5. * Screens Functions Declarations (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. #ifndef SCREENS_H
  26. #define SCREENS_H
  27. #define GAME_FPS 60.0
  28. #define TIME_FACTOR 60.0/GAME_FPS
  29. #define MAX_KILLS 128
  30. //----------------------------------------------------------------------------------
  31. // Types and Structures Definition
  32. //----------------------------------------------------------------------------------
  33. typedef enum GameScreen { LOGO, TITLE, OPTIONS, GAMEPLAY, ENDING } GameScreen;
  34. //----------------------------------------------------------------------------------
  35. // Global Variables Definition
  36. //----------------------------------------------------------------------------------
  37. GameScreen currentScreen;
  38. // NOTE: This is all the data used in the game
  39. SpriteFont font;
  40. Shader colorBlend;
  41. Texture2D atlas01;
  42. Texture2D atlas02;
  43. Sound fxJump;
  44. Sound fxDash;
  45. Sound fxEatLeaves;
  46. Sound fxDieSnake;
  47. Sound fxDieDingo;
  48. Sound fxDieOwl;
  49. Sound fxHitResin;
  50. Sound fxWind;
  51. // Global Variables (required by ending screen and gameplay screen)
  52. int score;
  53. int hiscore;
  54. int killHistory[MAX_KILLS];
  55. int killer;
  56. int seasons;
  57. int years;
  58. int currentLeaves;
  59. int currentSeason;
  60. int initSeason;
  61. int initYears;
  62. int rainChance;
  63. #ifdef __cplusplus
  64. extern "C" { // Prevents name mangling of functions
  65. #endif
  66. //----------------------------------------------------------------------------------
  67. // Logo Screen Functions Declaration
  68. //----------------------------------------------------------------------------------
  69. void InitLogoScreen(void);
  70. void UpdateLogoScreen(void);
  71. void DrawLogoScreen(void);
  72. void UnloadLogoScreen(void);
  73. int FinishLogoScreen(void);
  74. //----------------------------------------------------------------------------------
  75. // Title Screen Functions Declaration
  76. //----------------------------------------------------------------------------------
  77. void InitTitleScreen(void);
  78. void UpdateTitleScreen(void);
  79. void DrawTitleScreen(void);
  80. void UnloadTitleScreen(void);
  81. int FinishTitleScreen(void);
  82. //----------------------------------------------------------------------------------
  83. // Options Screen Functions Declaration
  84. //----------------------------------------------------------------------------------
  85. void InitOptionsScreen(void);
  86. void UpdateOptionsScreen(void);
  87. void DrawOptionsScreen(void);
  88. void UnloadOptionsScreen(void);
  89. int FinishOptionsScreen(void);
  90. //----------------------------------------------------------------------------------
  91. // Gameplay Screen Functions Declaration
  92. //----------------------------------------------------------------------------------
  93. void InitGameplayScreen(void);
  94. void UpdateGameplayScreen(void);
  95. void DrawGameplayScreen(void);
  96. void UnloadGameplayScreen(void);
  97. int FinishGameplayScreen(void);
  98. //----------------------------------------------------------------------------------
  99. // Ending Screen Functions Declaration
  100. //----------------------------------------------------------------------------------
  101. void InitEndingScreen(void);
  102. void UpdateEndingScreen(void);
  103. void DrawEndingScreen(void);
  104. void UnloadEndingScreen(void);
  105. int FinishEndingScreen(void);
  106. #ifdef __cplusplus
  107. }
  108. #endif
  109. #endif // SCREENS_H