Skip to content

feat: implement bgm and audiomanager - #187

Merged
chowjustin merged 2 commits into
120-implement-gamescene-systems-array-didmove-update-touchesbegan-registerentityfrom
186-implement-bgm-music
May 20, 2026
Merged

chowjustin merged 2 commits into
120-implement-gamescene-systems-array-didmove-update-touchesbegan-registerentityfrom
186-implement-bgm-music

Conversation

@chowjustin

Copy link
Copy Markdown
Contributor

This pull request introduces background music (BGM) functionality to the app by adding a new AudioManager singleton class and integrating it into the app launch process. The AudioManager handles loading, playing, and pausing BGM, and responds appropriately to app lifecycle events and audio interruptions.

New background music management:

  • Added a new AudioManager singleton class in AudioManager.swift that loads and manages playback of a bundled bgm.mp3 file, including looping and volume control.
  • Implemented handling for audio interruptions (like phone calls or Siri) to automatically pause and resume BGM as needed.
  • Integrated app lifecycle event handling so that BGM pauses when the app backgrounds and resumes when it returns to the foreground.

App launch integration:

  • Updated AppDelegate.swift to start background music playback when the app finishes launching by calling AudioManager.shared.startBGM().

@chowjustin chowjustin self-assigned this May 20, 2026
@chowjustin
chowjustin merged commit 6e7344e into 120-implement-gamescene-systems-array-didmove-update-touchesbegan-registerentity May 20, 2026
3 of 4 checks passed
@chowjustin chowjustin linked an issue May 20, 2026 that may be closed by this pull request
KeweKiwi added a commit that referenced this pull request May 20, 2026
* feat: add initial codebase implementation

* resize layout

* feat: GameScene, HandAnimation, Assets, etc.

* feat: implement bgm and audiomanager (#187)

* feat: implement bgm and audiomanager

* docs: add resources to directory structure

* feat: integrate main menu and game over navigation to gameplay (#189)

* style: add Main Menu UI, main menu background asset

* feat: implement GameOverOverlay with navigation

- Created GameOverOverlay as an SKSpriteNode to display match outcomes dynamically over the game arena.
- Implemented SF Pro Rounded font rendering via NSAttributedString for all UI text.
- Wired up SKTransition.fade routing between Menu, Game, and Rematch flows.
- Integrated GameOverOverlay with EventBus and UISystem using callback closures.

* feat: hide hud and skills overlay on gameover state

---------

Co-authored-by: Sharon Tan <shasatanjaya@gmail.com>

* feat: update game sfx behavior

---------

Co-authored-by: chowjustin <justin.chow05@gmail.com>
Co-authored-by: Vallykrie <nathansudiara@gmail.com>
Co-authored-by: Justin Chow <138012584+chowjustin@users.noreply.github.com>
Co-authored-by: Sharon Tan <shasatanjaya@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Implement BGM Music

1 participant