From 074ca8c4b60bf5ab61be64a971105335c49ce8e8 Mon Sep 17 00:00:00 2001 From: Ritabrata Das Date: Sun, 13 Sep 2026 11:46:52 +0530 Subject: add music --- main.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'main.cpp') diff --git a/main.cpp b/main.cpp index cdd850a..b2e8c72 100644 --- a/main.cpp +++ b/main.cpp @@ -19,7 +19,8 @@ namespace { void drawFrame(GameState& currentGameState) { - UpdateMusicStream(g_bgMusic); + UpdateMusicStream(currentGameState.BGMusic); + printf("%f\n", GetMusicTimePlayed(currentGameState.BGMusic)); // if (GetMusicTimePlayed(g_bgMusic) >= GetMusicTimeLength(g_bgMusic)) { // SeekMusicStream(g_bgMusic, 0); // } @@ -123,9 +124,8 @@ int main() { // }; // TODO : Implement Asset Manager // DisableCursor(); - // g_bgMusic = LoadMusicStream("../assets/audio/bgm/bg.wav"); - // PlayMusicStream(g_bgMusic); - SetMusicVolume(g_bgMusic, 0.5f); + currentGameState.BGMusic = LoadMusicStream("../assets/audio/bgm/bgm.mp3"); + PlayMusicStream(currentGameState.BGMusic); currentGameState.AssetManager.init(); #if defined (__EMSCRIPTEN__) currentGameState.touchScreenMode = (bool)isOnPhone(); -- cgit v1.2.3