Fix main menu music looping

soundtrack
Ensar Sarajčić 2021-11-22 21:23:06 +01:00
parent 9cdfc17815
commit e4b432b22a
4 changed files with 9 additions and 6 deletions

Binary file not shown.

View File

@ -15,7 +15,7 @@ force/8_bit=false
force/mono=false force/mono=false
force/max_rate=false force/max_rate=false
force/max_rate_hz=44100 force/max_rate_hz=44100
edit/trim=false edit/trim=true
edit/normalize=false edit/normalize=false
edit/loop=false edit/loop=true
compress/mode=0 compress/mode=0

View File

@ -13,4 +13,4 @@
1/4 :-d :-a 1/8 :-e :-c 1/4 :-g :d :-f 1/8 :e :g 1/4 :f :a 1/16 :g 1/4 :f 1/2 :c]) [:piano :violin :acoustic-bass]))) 1/4 :-d :-a 1/8 :-e :-c 1/4 :-g :d :-f 1/8 :e :g 1/4 :f :a 1/16 :g 1/4 :f 1/2 :c]) [:piano :violin :acoustic-bass])))
(concat (concat
(map intro [70 100])) (map intro [70]))

View File

@ -2,11 +2,14 @@ extends Node
export var main_theme: AudioStream export var main_theme: AudioStream
onready var themes = {"main": main_theme} var current_theme = null
onready var themes = {"main": main_theme}
onready var player: AudioStreamPlayer = $Player onready var player: AudioStreamPlayer = $Player
func play_theme(theme: String) -> void: func play_theme(theme: String) -> void:
if theme != current_theme:
player.stream = themes[theme] player.stream = themes[theme]
player.play() player.play()
current_theme = theme