extends Node

# AudioStreamPlayer do odtwarzania muzyki
var music_player: AudioStreamPlayer

func _ready():
	# Tworzymy AudioStreamPlayer
	music_player = AudioStreamPlayer.new()
	add_child(music_player)
	
	# Ładujemy muzykę
	var music_stream = load("res://assets/sounds/music/game_music.mp3") as AudioStream
	music_stream.set_loop(true)
	music_player.stream = music_stream

# Funkcja do uruchomienia muzyki
func play_music():
	if not music_player.playing:
		music_player.play()
