mirror of
https://github.com/raysan5/raylib.git
synced 2025-12-25 10:22:33 -05:00
Updated games to latest raylib version
Updated to new audio system
This commit is contained in:
@ -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)
|
||||
@ -59,8 +59,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;
|
||||
@ -118,6 +119,8 @@ int main()
|
||||
{
|
||||
// Update
|
||||
//----------------------------------------------------------------------------------
|
||||
UpdateMusicStream(music); // Refill music stream buffers (if required)
|
||||
|
||||
framesCounter++;
|
||||
|
||||
// Game screens management
|
||||
@ -458,10 +461,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;
|
||||
|
||||
@ -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;
|
||||
|
||||
@ -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)
|
||||
@ -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
|
||||
|
||||
Reference in New Issue
Block a user