summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--assets/audio/bgm/bgm.mp3bin0 -> 1729293 bytes
-rw-r--r--lib/gameState.hpp4
-rw-r--r--main.cpp8
-rw-r--r--screen/main_menu.cpp2
4 files changed, 7 insertions, 7 deletions
diff --git a/assets/audio/bgm/bgm.mp3 b/assets/audio/bgm/bgm.mp3
new file mode 100644
index 0000000..b4762d4
--- /dev/null
+++ b/assets/audio/bgm/bgm.mp3
Binary files differ
diff --git a/lib/gameState.hpp b/lib/gameState.hpp
index edfedde..659f7e0 100644
--- a/lib/gameState.hpp
+++ b/lib/gameState.hpp
@@ -12,8 +12,6 @@ constexpr int VIRTUAL_SCREEN_H = 400;
constexpr float WEB_RENDER_SCALE = 2.0f;
constexpr Vector2 ZERO_VEC = {0,0};
-inline Music g_bgMusic;
-
enum DialogueState {
DIALOGUE_OFF,
DIALOGUE_SCROLLING,
@@ -113,4 +111,6 @@ struct GameState {
bool GameOver = false;
float GameOverTime = -1.0f;
std::set<int> explored = {};
+
+ Music BGMusic;
};
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();
diff --git a/screen/main_menu.cpp b/screen/main_menu.cpp
index bc7ad08..afe2e78 100644
--- a/screen/main_menu.cpp
+++ b/screen/main_menu.cpp
@@ -39,6 +39,6 @@ void drawMainMenu(GameState &gs){
}
}
ui::DrawTextV("Happy Cirno Day", {22, 20}, 22, ColorAlpha(YELLOW, Clamp(gs.timeSinceSceneChange/(SCENE_CHANGE/2.0f), 0, 1)));
- ui::DrawTextV("A short story by\nsamosagaming69 (Odia\ntwinky boy) &\nsilli_chilli", {22, 48}, 14, ColorAlpha(GREEN, Clamp(gs.timeSinceSceneChange/(SCENE_CHANGE/2.0f), 0, 1)));
+ ui::DrawTextV("A short story by\nsamosagaming69 &\nsilli_chilli", {22, 48}, 14, ColorAlpha(GREEN, Clamp(gs.timeSinceSceneChange/(SCENE_CHANGE/2.0f), 0, 1)));
ui::DrawTextV("Music: Tomboyish Prelude\nAlbum: Fantasy Kaleidoscope OST\nCircle: Yuuhei Satellite\nArrangement: Iceon", {3, 323}, 12, ColorAlpha(ORANGE, Clamp(gs.timeSinceSceneChange/(SCENE_CHANGE/2.0f), 0, 1)));
}