69 lines
2.2 KiB
GDScript
69 lines
2.2 KiB
GDScript
extends Node
|
|
|
|
@onready var mapNode = get_node("/root/tutorial")
|
|
var mapPath = "res://scenes/tutorial.tscn"
|
|
var audio_stream_player = AudioStreamPlayer.new()
|
|
@onready var environment = get_node("WorldEnvironment").get_environment()
|
|
|
|
func _ready():
|
|
Global.currentMapNode = mapNode
|
|
Global.currentMapPath = mapPath
|
|
Global.playerHealth = 100
|
|
Global.fatigue = 100
|
|
Global.roundTimer = 90.0
|
|
Global.tutorialCompleted = true
|
|
Global.save_data()
|
|
|
|
|
|
func _process(delta):
|
|
if Input.is_action_just_released("menu"):
|
|
$VideoStreamPlayer.stop()
|
|
$skipLabel.visible = false
|
|
if $VideoStreamPlayer.is_playing():
|
|
Global.playerDisable = true
|
|
$skipLabel.visible = true
|
|
else:
|
|
Global.playerDisable = false
|
|
$skipLabel.visible = false
|
|
if Global.tutorialComplete and not Global.tutorialTimerCompleted:
|
|
if audio_stream_player.playing == false:
|
|
var randomnum = RandomNumberGenerator.new().randi_range(0, 6)
|
|
if randomnum == 0:
|
|
play_music(load("res://music/alexander-nakarada-chase.mp3"))
|
|
Global.musicName = "Chase"
|
|
Global.musicAuthor = "Alexander Nakarada"
|
|
elif randomnum == 1:
|
|
play_music(load("res://music/DRIVE.mp3"))
|
|
Global.musicName = "DRIVE"
|
|
Global.musicAuthor = "Alex-Productions"
|
|
elif randomnum == 2:
|
|
play_music(load("res://music/Fluffing-a-Duck.mp3"))
|
|
Global.musicName = "Fluffing a Duck"
|
|
Global.musicAuthor = "Kevin MacLeod"
|
|
elif randomnum == 3:
|
|
play_music(load("res://music/Monkeys-Spinning-Monkeys.mp3"))
|
|
Global.musicName = "Monkeys Spinning Monkeys"
|
|
Global.musicAuthor = "Kevin MacLeod"
|
|
elif randomnum == 4:
|
|
play_music(load("res://music/Run-Amok.mp3"))
|
|
Global.musicName = "Run Amok"
|
|
Global.musicAuthor = "Kevin MacLeod"
|
|
elif randomnum == 5:
|
|
play_music(load("res://music/Sneaky-Snitch.mp3"))
|
|
Global.musicName = "Sneaky Snitch"
|
|
Global.musicAuthor = "Kevin MacLeod"
|
|
elif randomnum == 6:
|
|
play_music(load("res://music/Wallpaper.mp3"))
|
|
Global.musicName = "Wallpaper"
|
|
Global.musicAuthor = "Kevin MacLeod"
|
|
else:
|
|
print("This shouldn't ever be called, toyland.gd")
|
|
Global.musicUpdated = true
|
|
if Global.tutorialTimerCompleted:
|
|
audio_stream_player.playing = false
|
|
|
|
|
|
func play_music(music):
|
|
audio_stream_player.set_stream(music)
|
|
add_child(audio_stream_player)
|
|
audio_stream_player.play()
|