
- Mostly finished the settings menu - Got basic AI working on easy difficulty - Changed when animations are loaded - Music now changes when you hit play - Changed how AI will work. All enemies should only need the combatant script now
38 lines
1.1 KiB
GDScript
38 lines
1.1 KiB
GDScript
class_name MusicPlayer extends AudioStreamPlayer
|
|
|
|
@onready var data: Data = get_node("/root/Root/Data")
|
|
var mainMenuPlaylist: Playlist = load("res://Resources/Playlists/mainMenu.tres")
|
|
var creditsPlaylist: Playlist = load("res://Resources/Playlists/credits.tres")
|
|
var tavernPlaylist: Playlist = load("res://Resources/Playlists/tavern.tres")
|
|
var arenaPlaylist: Playlist = load("res://Resources/Playlists/arena.tres")
|
|
var currentLoc: Playlist
|
|
|
|
# Called when the node enters the scene tree for the first time.
|
|
func _ready():
|
|
mainMenuPlaylist.init(false)
|
|
creditsPlaylist.init(false)
|
|
tavernPlaylist.init(true)
|
|
arenaPlaylist.init(true)
|
|
currentLoc = mainMenuPlaylist
|
|
setLoc(data.loc)
|
|
|
|
func _onSongFinished() -> void:
|
|
stream = load(currentLoc.getNext())
|
|
play()
|
|
|
|
func setLoc(loc: Data.Location):
|
|
currentLoc.index = 0
|
|
stop()
|
|
match loc:
|
|
Data.Location.MAINMENU:
|
|
currentLoc = mainMenuPlaylist
|
|
Data.Location.CREDITS:
|
|
currentLoc = creditsPlaylist
|
|
Data.Location.TAVERN:
|
|
currentLoc = tavernPlaylist
|
|
Data.Location.ARENA:
|
|
currentLoc = arenaPlaylist
|
|
Data.Location.DEAD:
|
|
pass
|
|
_onSongFinished()
|