chickensoft-games / GameDemo

The Chickensoft Game Demo — a fully tested, third-person 3D game built with Godot and C#. Now with saving and loading!
https://chickensoft.games
MIT License
322 stars 20 forks source link

fix: prevent doubled music #6

Closed wlsnmrk closed 8 months ago

wlsnmrk commented 8 months ago

Fixes #5 by stopping and restarting the game music when the player dies.

Additionally, while testing possible fixes for that issue, I discovered that it was also possible to get doubled menu music by starting the game and then rapidly returning to the menu. (Fading the menu music in while it's still fading out kills the tween that eventually stops the old stream.) I've fixed that the same way, by stopping the menu-music player before fading it in when entering the main-menu state.