diff options
| author | raysan5 <raysan5@gmail.com> | 2016-08-11 12:08:41 +0200 |
|---|---|---|
| committer | raysan5 <raysan5@gmail.com> | 2016-08-11 12:08:41 +0200 |
| commit | 29f14186c1da2c73c6e0c94c8a744f163784e762 (patch) | |
| tree | 1b0af18634d79c6aaf4ef7bb6570db766c71b039 /games/just_do | |
| parent | 289e04a62a64a6e82aa5da3397baaa7f48cc45ed (diff) | |
| download | raylib-29f14186c1da2c73c6e0c94c8a744f163784e762.tar.gz raylib-29f14186c1da2c73c6e0c94c8a744f163784e762.zip | |
Updated games to latest raylib version
Updated to new audio system
Diffstat (limited to 'games/just_do')
| -rw-r--r-- | games/just_do/just_do.c | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/games/just_do/just_do.c b/games/just_do/just_do.c index beac9e14..811150d3 100644 --- a/games/just_do/just_do.c +++ b/games/just_do/just_do.c @@ -6,7 +6,7 @@ * * Developed by: Ramon Santamaria (Ray San) * -* This game has been created using raylib (www.raylib.com) +* This game has been created using raylib 1.6 (www.raylib.com) * raylib is licensed under an unmodified zlib/libpng license (View raylib.h for details) * * raylib - Copyright (c) 2015 Ramon Santamaria (Ray San - raysan@raysanweb.com) @@ -23,7 +23,7 @@ //---------------------------------------------------------------------------------- // Global Variables Definition (local to this module) //---------------------------------------------------------------------------------- -const int screenWidth = 1280; // Moved to screens.h +const int screenWidth = 1280; // Moved to screens.h const int screenHeight = 720; // Moved to screens.h // Required variables to manage screen transitions (fade-in, fade-out) @@ -35,6 +35,7 @@ int transToScreen = -1; int framesCounter = 0; //static Sound levelWin; +Music music; //---------------------------------------------------------------------------------- // Local Functions Declaration @@ -57,10 +58,11 @@ int main(void) //SetupFlags(FLAG_FULLSCREEN_MODE); InitWindow(screenWidth, screenHeight, windowTitle); - // TODO: Load global data here (assets that must be available in all screens, i.e. fonts) + // Load global data here (assets that must be available in all screens, i.e. fonts) InitAudioDevice(); levelWin = LoadSound("resources/win.wav"); + music = LoadMusicStream("resources/ambient.ogg"); // Setup and Init first screen currentScreen = LOGO; @@ -85,8 +87,9 @@ int main(void) // De-Initialization //-------------------------------------------------------------------------------------- - // TODO: Unload all global loaded data (i.e. fonts) here! + // Unload all global loaded data (i.e. fonts) here! UnloadSound(levelWin); + UnloadMusicStream(music); CloseAudioDevice(); @@ -197,6 +200,8 @@ void UpdateDrawFrame(void) InitLevel08Screen(); } + UpdateMusicStream(music); + switch(currentScreen) { case LOGO: @@ -209,8 +214,8 @@ void UpdateDrawFrame(void) TransitionToScreen(LEVEL00); InitLevel00Screen(); - PlayMusicStream("resources/ambient.ogg"); - SetMusicVolume(0.6f); + PlayMusicStream(music); + SetMusicVolume(music, 0.6f); } } break; case LEVEL00: |
