dinosaur-exploder icon indicating copy to clipboard operation
dinosaur-exploder copied to clipboard

[Bug]: audio Controls Lose State After Screen Navigation

Open AlexiSkyline opened this issue 8 months ago • 3 comments

👉 Please confirm the following

❌ Current Behavior

The volume up/down input and the mute button on the main screen stop working after navigating to the ship selection screen and returning to the main menu.

✅ Expected Behavior

The volume up/down input and the mute button on the main screen should continue to work normally after navigating to the ship selection screen and returning to the main menu. If the game is muted from the main menu, the mute state should persist across all screens and the game should remain globally silenced. The global audio state (volume level and mute status) should remain consistent throughout the entire app, regardless of screen navigation.

🚩 Steps To Reproduce

🚩 Steps To Reproduce

  1. Open the game and go to the main menu.
  2. Use the volume up/down input or press the mute button to adjust/mute the sound.
  3. Navigate to the ship selection screen.
  4. Return to the main menu.
  5. Notice that the volume input and mute button no longer work as expected.
  6. If the game was muted before navigation, sound may return unexpectedly or controls may become unresponsive.

https://github.com/user-attachments/assets/e1c79d8b-72a4-4f8d-a7d2-e9dbc1349dfc

💻 Environment

- OS:
- Game version: 1.0.0

ℹ️ Additional information

It appears that the audio object is being reinitialized or recreated on each screen, instead of maintaining a single global instance. This could be causing the audio state (volume/mute) to reset or desync when navigating between screens.

AlexiSkyline avatar Apr 15 '25 04:04 AlexiSkyline

👋 Hello @AlexiSkyline, thank you for your interest in Dinosaur Exploder 🦖! Please visit our ⭐️ Discord server if you need help about something.

If this is a 🐛 Bug Report, please provide a minimum reproducible example to help us debug it. If this is a 🆕 feature request, please provide all your ideas, or better yet: a model of what you'd like to improve in the game.

  • ✅ Verify that you have well fill out the different checkboxes in the issue template.

github-actions[bot] avatar Apr 15 '25 04:04 github-actions[bot]

Oh yes there is indeed a big problem. We should refactor it and just remove the btn at the right to avoid having two different buttons that do similar things... I don't know but good issue, thanks !

jvondermarck avatar Apr 15 '25 11:04 jvondermarck

There is a BIG refactor to make on the sound management. If we turn off the sound, the sound should be turned off in the home screen, in the lobby and while playing. Because so far when we turn off the sound, it works only on the home menu, not in the lobby and while playing.

jvondermarck avatar Apr 17 '25 16:04 jvondermarck

I can solve this problem .

SakshamKaundal avatar May 13 '25 17:05 SakshamKaundal

Awesome, good luck ! @SakshamKaundal

jvondermarck avatar May 14 '25 17:05 jvondermarck

What happening here for each page it have its private object newly created, so sound change when we play game , do you think the way to solve problem is to make central audioManager that control everything or there can be a simpler way to fix this ?

SakshamKaundal avatar May 15 '25 03:05 SakshamKaundal

I have put up a PR please review it

SakshamKaundal avatar May 15 '25 07:05 SakshamKaundal

The issue is still active. @SakshamKaundal did a first part, there is still some work to do :)

jvondermarck avatar May 15 '25 16:05 jvondermarck

Hello, may I help with what's left of the issue?, idk if it's on progress rn or something is missing?

santiagoOrozco-encora avatar Jul 09 '25 22:07 santiagoOrozco-encora

Hello @santiagoOrozco-encora yep you can work on this issue. You can see the TODOs left : https://github.com/jvondermarck/dinosaur-exploder/pull/207#pullrequestreview-2844419227 from the last PR of the contributor who work on the issue.

jvondermarck avatar Jul 10 '25 09:07 jvondermarck

Hi , yes there are issues i have made a centralized audio the remain things are to integrate it with every screen it have some bugs that audio loss please test the game and switch to screens game have too much sound and ship selection have non

On Thu, 10 Jul 2025 at 04:09, santiagoOrozco-encora < @.***> wrote:

santiagoOrozco-encora left a comment (jvondermarck/dinosaur-exploder#146) https://github.com/jvondermarck/dinosaur-exploder/issues/146#issuecomment-3054315230

Hello, may I help with what's left of the issue?, idk if it's on progress rn or something is missing?

— Reply to this email directly, view it on GitHub https://github.com/jvondermarck/dinosaur-exploder/issues/146#issuecomment-3054315230, or unsubscribe https://github.com/notifications/unsubscribe-auth/BAXKF45F42INN7R7KN2CXWL3HWK3XAVCNFSM6AAAAAB3ERXEG2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZTANJUGMYTKMRTGA . You are receiving this because you were mentioned.Message ID: @.***>

SakshamKaundal avatar Jul 10 '25 13:07 SakshamKaundal

Hello, sorry for the delay, I integrated the manager with the main menu so we use only one audio manager, also I added the missing function to avoid the audio loose between the screens and I use the settings audio on the launch so it rememeber the audio volume for the next time the game is started, andy feedback or missing thing Im here :D

santiagoOrozco-encora avatar Jul 14 '25 21:07 santiagoOrozco-encora

The issue is still open and the bug is still active...

jvondermarck avatar Oct 15 '25 20:10 jvondermarck

Hello! I noticed that the sound setting is not loaded on the next game startup (after muting and exiting the game, the sound is still on upon the next startup with the icon in the first screen showing the wrong status). Can I help in solvig this?

ftaramo avatar Oct 26 '25 11:10 ftaramo

Hiii, yes you can definitely help with this, no problem at all !! Good luck @ftaramo Thanks so much for your contribution and sorry for the late answer !

jvondermarck avatar Oct 29 '25 19:10 jvondermarck

Hi , I want to apologise to leave this task on the way. i want to continue contributing to this project can you tell me what me to be done here

On 30 Oct 2025, at 12:59 AM, Julien Von Der Marck @.***> wrote:

jvondermarck left a comment (jvondermarck/dinosaur-exploder#146) https://github.com/jvondermarck/dinosaur-exploder/issues/146#issuecomment-3463487255 Hiii, yes you can definitely help with this, no problem at all !! Good luck @ftaramo https://github.com/ftaramo Thanks so much for your contribution and sorry for the late answer !

— Reply to this email directly, view it on GitHub https://github.com/jvondermarck/dinosaur-exploder/issues/146#issuecomment-3463487255, or unsubscribe https://github.com/notifications/unsubscribe-auth/BAXKF47ZNC472G262J3H72332EIQRAVCNFSM6AAAAAB3ERXEG2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZTINRTGQ4DOMRVGU. You are receiving this because you were mentioned.

SakshamKaundal avatar Oct 29 '25 19:10 SakshamKaundal

Hello @SakshamKaundal have a look on the last comments of this PR, there are still some sounds issues in the game let's resolve them.

You can see the TODOs left : https://github.com/jvondermarck/dinosaur-exploder/pull/207#pullrequestreview-2844419227 from the last PR of the contributor who work on the issue.

jvondermarck avatar Oct 29 '25 19:10 jvondermarck

from what i can see when we go to ship selection audio is good ,but if we go back audio is gone. except everything is fine right ?

SakshamKaundal avatar Oct 30 '25 12:10 SakshamKaundal

Yes it is mainly if we go back, we lose the audio and also, if we navigate screen by screen, the song seems to START again from scratch, so like if we init the audio all over again, so it's weird, we should have one instance only @SakshamKaundal

jvondermarck avatar Oct 30 '25 12:10 jvondermarck