Browse Source

Update raylib_game.c

main
Ray 3 years ago
parent
commit
9483b0ceac
  1. 10
      src/raylib_game.c

10
src/raylib_game.c

@ -1,6 +1,6 @@
/******************************************************************************************* /*******************************************************************************************
* *
* raylib Game Template * raylib game template
* *
* <Game title> * <Game title>
* <Game description> * <Game description>
@ -21,6 +21,7 @@
//---------------------------------------------------------------------------------- //----------------------------------------------------------------------------------
// Shared Variables Definition (global) // Shared Variables Definition (global)
// NOTE: Those variables are shared between modules through screens.h
//---------------------------------------------------------------------------------- //----------------------------------------------------------------------------------
GameScreen currentScreen = 0; GameScreen currentScreen = 0;
Font font = { 0 }; Font font = { 0 };
@ -28,7 +29,7 @@ Music music = { 0 };
Sound fxCoin = { 0 }; Sound fxCoin = { 0 };
//---------------------------------------------------------------------------------- //----------------------------------------------------------------------------------
// Global Variables Definition (local to this module) // Local Variables Definition (local to this module)
//---------------------------------------------------------------------------------- //----------------------------------------------------------------------------------
static const int screenWidth = 800; static const int screenWidth = 800;
static const int screenHeight = 450; static const int screenHeight = 450;
@ -99,7 +100,7 @@ int main(void)
default: break; default: break;
} }
// Unload all global loaded data (i.e. fonts) here! // Unload global data loaded
UnloadFont(font); UnloadFont(font);
UnloadMusicStream(music); UnloadMusicStream(music);
UnloadSound(fxCoin); UnloadSound(fxCoin);
@ -115,7 +116,6 @@ int main(void)
//---------------------------------------------------------------------------------- //----------------------------------------------------------------------------------
// Module specific Functions Definition // Module specific Functions Definition
//---------------------------------------------------------------------------------- //----------------------------------------------------------------------------------
// Change to next screen, no transition // Change to next screen, no transition
static void ChangeToScreen(int screen) static void ChangeToScreen(int screen)
{ {
@ -152,7 +152,7 @@ static void TransitionToScreen(int screen)
transAlpha = 0.0f; transAlpha = 0.0f;
} }
// Update transition effect // Update transition effect (fade-in, fade-out)
static void UpdateTransition(void) static void UpdateTransition(void)
{ {
if (!transFadeOut) if (!transFadeOut)

Loading…
Cancel
Save