dylan-power / dinosaur-exploder

A classic inspired shoot em' up game written in Java with JavaFX and FXGL.
https://dinosaur-exploder.freecluster.eu/
MIT License
22 stars 55 forks source link

[Feature]: Manage sounds on the game and control the volume #76

Closed jvondermarck closed 2 months ago

jvondermarck commented 2 years ago

👉 Please confirm the following

🤔 Is your proposal related to a problem?

No response

😍 Describe the solution you'd like

It would be great to have a button on the home screen to put the sound of the game on or off. image

👍️ Describe alternatives you've considered

It would be great maybe to have a gauge, to increase or decrease the intensity of the sound?

✍ Additional context

No response

RamonASV commented 2 years ago

Hello! May I work on this issue? I already have an idea on how to work this out.

jvondermarck commented 2 years ago

Hi @RamonASV yeah of course, go ahead :)

RamonASV commented 2 years ago

I'm currently having some troubles on this, as DinosaurController.java uses FXGL.play() instead of a MediaPlayer. As of now I can only mute the music in the main menu. I also noticed that when you lose and return to the Main Menu the gameBackground.wav file keeps playing instead of the mainMenu.wav

jvondermarck commented 2 years ago

For the first issue, maybe you can create a boolean variable for the music to know if the game has to put the home screen sound and the game sounds while playing, try to do that maybe?

if (game.isMusicOn){ play.music(engine.wav;}

(the code is false but it's just an example)

jvondermarck commented 2 years ago

and for the second issue indeed something is going wrong.. that's weird.. Maybe there is a method from FXGL to stop all sounds activated and then you can activate the home screen sound again when u go back to the menu?

Vishrut19 commented 2 years ago

@RamonASV can I help you out with it ?

jvondermarck commented 2 years ago

Hi @Vishrut19 you can finish this issue alone, I am not sure he's still working on it, so go ahead :)

Vishrut19 commented 2 years ago

Hi @Vishrut19 you can finish this issue alone, I am not sure he's still working on it, so go ahead :)

Okay I will try to do whatever I can.

YesShubham01 commented 1 year ago

Hey, is this issue closed? , If not i would like to work on it.

jvondermarck commented 1 year ago

@YesShubham01 Heyy, you still can work on it :)

Anshul439 commented 1 year ago

Hey, is the issue solved? If not, can you assign it to me?

jvondermarck commented 1 year ago

Hi @Anshul439 this issue is all yours ! You can work on it !

Anshul439 commented 1 year ago

Hey! I have made a PR. Please check it out and let me know if the problem is solved.

jvondermarck commented 6 months ago

Now it would be better to also control the volume.

alemarin5 commented 3 months ago

Hi, can I work on this issue?

jvondermarck commented 3 months ago

Hi, can I work on this issue?

Heyy, @alemarin5 absolutely you can work on it !