1
Fork 0
mirror of https://github.com/Steffo99/hella-farm.git synced 2024-11-22 16:14:22 +00:00
hella-farm/scenes/game/music.gd

27 lines
515 B
GDScript3
Raw Normal View History

2024-04-29 04:22:15 +00:00
extends Node
class_name Music
@onready var layer_1: AudioStreamPlayer = %"Layer1"
@onready var layer_2: AudioStreamPlayer = %"Layer2"
@onready var layer_3: AudioStreamPlayer = %"Layer3"
func do_sync():
var position = layer_1.get_playback_position()
layer_1.stop()
layer_2.stop()
layer_3.stop()
layer_1.play(position)
layer_2.play(position)
layer_3.play(position)
func enable_layer_1():
layer_1.volume_db = 0
func enable_layer_2():
layer_2.volume_db = 0
func enable_layer_3():
layer_3.volume_db = 0