diff options
| author | Ritabrata Das <[email protected]> | 2026-09-13 11:46:52 +0530 |
|---|---|---|
| committer | Ritabrata Das <[email protected]> | 2026-09-13 11:46:52 +0530 |
| commit | 074ca8c4b60bf5ab61be64a971105335c49ce8e8 (patch) | |
| tree | dfbbe640bdc9e790206770324145b570e24ce164 /main.cpp | |
| parent | 6488c942e10c7685a1040f6c6ff74a534e72b95c (diff) | |
add music
Diffstat (limited to 'main.cpp')
| -rw-r--r-- | main.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -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(); |
