Skip to content

Added new Audio Manager to manage Audio accross the game #207

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 15, 2025

Conversation

SakshamKaundal
Copy link
Contributor

✅ PR Checklist

Tip

Please check the boxes below to confirm you followed the contribution guidelines:

  • [ x] My PR title follows the format: [Type]: clear description of change
  • [ x] I used the correct type: Feature, Fix, Refactor, Docs, Test, Chore
  • [x ] I reviewed my code and removed unnecessary debug logs or comments.
  • [ x] I tested my changes and verified they work as expected.
  • [ x] I ran the project to confirm it compiles and runs correctly.
  • [ x] I read the Code of Conduct and the Contribution Guidelines.

📝 What does this PR do?

  • ...

🔗 Related Issue

Link to the issue this PR addresses (if any)

📸 Screenshots / Demos (if applicable)

Note

🦖 No screenshots or demo provided.

💬 Extra Notes (Optional)

Note

🦕 No extra notes.


This PR introduces a major refactor to the audio system and general codebase improvements for Dinosaur Exploder.

Global audio control is now handled via a singleton AudioManager, allowing mute and volume to be managed consistently across all menus and gameplay.
Removed all per-component mute/volume logic and legacy sound code.
All sound and music playback now uses AudioManager and constants from GameConstants.
Cleaned up menu and controller code to avoid duplicate or broken audio logic.
Fixed resource path issues for sound files.
What's Working
Mute now works globally and instantly across the entire game.
Music and sound effects are played using the new AudioManager.
No more duplicate or broken sound logic in menus or gameplay.
Code is cleaner and easier to maintain.
Known Issues / To-Do
Audio volume slider is not fully functional yet:
Changing the volume updates the value in AudioManager, but some sound effects or music may not reflect the new volume immediately in all cases.
I am still working on a complete fix for this.
Some additional polish and testing is needed for edge cases (e.g., rapid menu switching, overlapping sounds).
Why Merge Now?
This PR is a significant step toward a more maintainable and user-friendly codebase.
It enables easier future improvements and bugfixes.
Merging now will allow others to build on top of the new audio system and help test the changes.
Note:
If you encounter any issues with audio or have suggestions for further improvements, please comment on this PR or open a new issue!

Next steps:

Finalize and test the volume slider for all audio.
Continue general codebase cleanup and bugfixes.
Thank you for reviewing!

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👋 Hello @SakshamKaundal, thank you for submitting in Dinosaur Exploder 🦖 PR! To allow your work to be integrated as seamlessly as possible, we advise you to:

  • ✅ Verify your PR is up-to-date with the repository /dinosaur-exploder main branch. If your PR is behind you can update your code by clicking the 'Update branch' button or by running git pull and git merge master locally.
  • ✅ Verify all Dinosaur Exploder Continuous Integration (CI) checks are passing.
  • ✅ Verify that you have well fill out the different checkboxes in the PR template.
  • ⚠️ Check that your code is clean: no code redundancy, variable and method names are correct, your code is understandable to everyone, and so on.
  • 💡 Reduce changes to the absolute minimum required for your bug fix or feature addition. "It is not daily increase but daily decrease, hack away the unessential. The closer to the source, the less wastage there is." — Bruce Lee

Copy link

Build preview 🚀

badge

Thanks for your contribution to this open-source project! ❤️

A new build has been generated for this pull request:

  • 🎮 Game Artifacts: 🐧 Linux / 🍎 macOS / 🪟 Windows
  • 🧪 Workflow Run: View Logs
  • 🔖 Commit: d6c9ba3176f809cfd75725cacb3e8f470c889d79

Tip

This JAR lets you test the latest version of the game from this PR.

Note: Artifacts auto-expire after ~90 days.

Happy testing & enjoy the game! 🎮

The DinoBot Team 🦖

Copy link
Owner

@jvondermarck jvondermarck left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great PR !!

Like u said, there are some TODOs left, can you create the different issues on the repo of the work to do ?

  • Changing the volume updates the value in AudioManager, but some sound effects or music may not reflect the new volume immediately in all cases.
  • Some additional polish and testing is needed for edge cases (e.g., rapid menu switching, overlapping sounds).

Mainly fix the issue related to the screen switching when we navigate through the home screen -> ship lobby -> weapon lobby => the audio looks like to start from scratch everytime

@jvondermarck jvondermarck merged commit 6b2a3c3 into jvondermarck:main May 15, 2025
5 checks passed
@SakshamKaundal
Copy link
Contributor Author

Thank you !
I'll try to make the game better...!

@jvondermarck
Copy link
Owner

That's very kind of you !! Thanks so much for your hard work and contributions !! @SakshamKaundal

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Development

Successfully merging this pull request may close these issues.

[Bug]: audio Controls Lose State After Screen Navigation
2 participants