Updated games to latest raylib version
Updated to new audio system
This commit is contained in:
parent
289e04a62a
commit
29f14186c1
9 changed files with 93 additions and 52 deletions
|
@ -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 - raysan@raysanweb.com)
|
||||
|
@ -39,7 +39,7 @@ int main()
|
|||
InitWindow(screenWidth, screenHeight, "Dr. Turtle & Mr. GAMERA");
|
||||
|
||||
// Initialize audio device
|
||||
InitAudioDevice();
|
||||
InitAudioDevice();
|
||||
|
||||
// Load game resources: textures
|
||||
Texture2D sky = LoadTexture("resources/sky.png");
|
||||
|
@ -62,8 +62,9 @@ int main()
|
|||
Sound die = LoadSound("resources/die.wav");
|
||||
Sound growl = LoadSound("resources/gamera.wav");
|
||||
|
||||
// Start playing streaming music
|
||||
PlayMusicStream("resources/speeding.ogg");
|
||||
// Load music stream and start playing music
|
||||
Music music = LoadMusicStream("resources/speeding.ogg");
|
||||
PlayMusicStream(music);
|
||||
|
||||
// Define scrolling variables
|
||||
int backScrolling = 0;
|
||||
|
@ -127,6 +128,8 @@ int main()
|
|||
{
|
||||
// Update
|
||||
//----------------------------------------------------------------------------------
|
||||
UpdateMusicStream(music); // Refill music stream buffers (if required)
|
||||
|
||||
framesCounter++;
|
||||
|
||||
// Sea color tint effect
|
||||
|
@ -483,10 +486,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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue