diff options
| author | raysan5 <[email protected]> | 2016-08-11 12:08:41 +0200 |
|---|---|---|
| committer | raysan5 <[email protected]> | 2016-08-11 12:08:41 +0200 |
| commit | 29f14186c1da2c73c6e0c94c8a744f163784e762 (patch) | |
| tree | 1b0af18634d79c6aaf4ef7bb6570db766c71b039 /games/drturtle/drturtle_final_web.c | |
| 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/drturtle/drturtle_final_web.c')
| -rw-r--r-- | games/drturtle/drturtle_final_web.c | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/games/drturtle/drturtle_final_web.c b/games/drturtle/drturtle_final_web.c index 25f4074b..bec7ebd0 100644 --- a/games/drturtle/drturtle_final_web.c +++ b/games/drturtle/drturtle_final_web.c @@ -12,7 +12,7 @@ * * Enjoy using raylib. :) * -* This game has been created using raylib 1.1 (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) * * Copyright (c) 2014 Ramon Santamaria (Ray San - [email protected]) @@ -54,6 +54,8 @@ Sound eat; Sound die; Sound growl; +Music music; + // Define scrolling variables int backScrolling = 0; int seaScrolling = 0; @@ -124,8 +126,9 @@ int main() die = LoadSound("resources/die.wav"); growl = LoadSound("resources/gamera.wav"); - // Start playing streaming music - PlayMusicStream("resources/speeding.ogg"); + // Load music stream and start playing music + music = LoadMusicStream("resources/speeding.ogg"); + PlayMusicStream(music); playerBounds = (Rectangle){ 30 + 14, playerRail*120 + 90 + 14, 100, 100 }; @@ -190,10 +193,10 @@ int main() UnloadSound(die); UnloadSound(growl); - StopMusicStream(); // Stop music - CloseAudioDevice(); // Close audio device + UnloadMusicStream(music); // Unload music + CloseAudioDevice(); // Close audio device - CloseWindow(); // Close window and OpenGL context + CloseWindow(); // Close window and OpenGL context //-------------------------------------------------------------------------------------- return 0; @@ -206,8 +209,8 @@ void UpdateDrawFrame(void) { // Update //---------------------------------------------------------------------------------- - UpdateMusicStream(); - + UpdateMusicStream(music); // Refill music stream buffers (if required) + framesCounter++; // Sea color tint effect |
