From f25ff53327baf97d7a1f4799e79f42503f1749bf Mon Sep 17 00:00:00 2001 From: Techwizz Date: Sat, 11 Mar 2023 18:50:43 -0700 Subject: [PATCH] Added music credits --- scenes/HUD.tscn | 24 ++++++++++++++++++++++++ scenes/mainmenu.tscn | 24 ++++++++++++++++++++++++ scripts/HUD.gd | 7 +++++++ scripts/global.gd | 3 +++ scripts/mainmenu.gd | 7 +++++++ scripts/maps/toyland.gd | 16 ++++++++++++++++ 6 files changed, 81 insertions(+) diff --git a/scenes/HUD.tscn b/scenes/HUD.tscn index 8beadad..5290185 100644 --- a/scenes/HUD.tscn +++ b/scenes/HUD.tscn @@ -154,3 +154,27 @@ offset_bottom = 593.0 theme_override_fonts/font = ExtResource("3_x1wqt") theme_override_font_sizes/font_size = 29 horizontal_alignment = 1 + +[node name="musicPanel" type="Panel" parent="."] +layout_mode = 0 +offset_left = 889.0 +offset_top = 548.0 +offset_right = 1146.0 +offset_bottom = 644.0 + +[node name="playingLabel" type="Label" parent="musicPanel"] +layout_mode = 0 +offset_left = 4.0 +offset_top = 14.0 +offset_right = 253.0 +offset_bottom = 40.0 +text = "Now playing: " +horizontal_alignment = 1 + +[node name="authorLabel" type="Label" parent="musicPanel"] +layout_mode = 0 +offset_left = 7.0 +offset_top = 58.0 +offset_right = 252.0 +offset_bottom = 81.0 +horizontal_alignment = 1 diff --git a/scenes/mainmenu.tscn b/scenes/mainmenu.tscn index 1fab586..fb5f366 100644 --- a/scenes/mainmenu.tscn +++ b/scenes/mainmenu.tscn @@ -134,6 +134,30 @@ texture = ExtResource("10_oafyi") [node name="AudioStreamPlayer" type="AudioStreamPlayer" parent="."] stream = ExtResource("11_6irkm") +[node name="musicPanel" type="Panel" parent="."] +visible = false +offset_left = 9.0 +offset_top = 327.0 +offset_right = 266.0 +offset_bottom = 423.0 + +[node name="playingLabel" type="Label" parent="musicPanel"] +layout_mode = 0 +offset_left = 4.0 +offset_top = 14.0 +offset_right = 253.0 +offset_bottom = 40.0 +text = "Now playing: " +horizontal_alignment = 1 + +[node name="authorLabel" type="Label" parent="musicPanel"] +layout_mode = 0 +offset_left = 7.0 +offset_top = 58.0 +offset_right = 252.0 +offset_bottom = 81.0 +horizontal_alignment = 1 + [connection signal="pressed" from="Button" to="." method="_on_button_pressed"] [connection signal="mouse_entered" from="playButton" to="." method="_on_play_button_mouse_entered"] [connection signal="mouse_exited" from="playButton" to="." method="_on_play_button_mouse_exited"] diff --git a/scripts/HUD.gd b/scripts/HUD.gd index 9df45e2..94636d8 100644 --- a/scripts/HUD.gd +++ b/scripts/HUD.gd @@ -17,6 +17,13 @@ func _process(delta): $startLabel.text = Global.HUDStartLabelText $Fatigue.value = Global.fatigue $Health.value = Global.playerHealth + if Global.musicUpdated == true: + Global.musicUpdated = false + $musicPanel/playingLabel.text = Global.musicName + $musicPanel/authorLabel.text = Global.musicAuthor + $musicPanel.visible = true + await get_tree().create_timer(3).timeout + $musicPanel.visible = false if Global.roundInSession == true and roundTimer >= 0: if scoresInitalized == false: scoresInitalized = true diff --git a/scripts/global.gd b/scripts/global.gd index 1141a49..dbddb09 100644 --- a/scripts/global.gd +++ b/scripts/global.gd @@ -25,6 +25,9 @@ var lastPersonToHitMe = 0 # Defined in the Bullet RPC var HUDPlayerDied = false # Tells the HUD.gd script that a point should be added or deducted var connectedPlayers = [] # Currently connected players by their name (NOT THEIR ID) var respawnTimeModifier = 1.0 # Affects how quickly the player respawns in death.gd +var musicName = "" # Name of music for HUD.gd +var musicAuthor = "" # Name of music author for HUD.gd +var musicUpdated = false # Tells HUD.gd to update labels and change visibility func _process(delta): if godMode: diff --git a/scripts/mainmenu.gd b/scripts/mainmenu.gd index 5a94c77..daa9bd3 100644 --- a/scripts/mainmenu.gd +++ b/scripts/mainmenu.gd @@ -1,6 +1,8 @@ extends Control var mainMenuScene = "res://scenes/mainmenu.tscn" +var musicName = "Fall From Grace" +var musicAuthor = "Darren Curtis" func _ready(): if Global.playingGame == true: @@ -12,6 +14,11 @@ func _ready(): $AudioStreamPlayer.playing = false if Global.playingGame == false: Global.connectedPlayers = [] + $musicPanel.visible = true + $musicPanel/playingLabel.text = musicName + $musicPanel/authorLabel.text = musicAuthor + await get_tree().create_timer(3).timeout + $musicPanel.visible = false func _process(delta): if Global.playingGame == false: diff --git a/scripts/maps/toyland.gd b/scripts/maps/toyland.gd index 8df8e11..8e5f42e 100644 --- a/scripts/maps/toyland.gd +++ b/scripts/maps/toyland.gd @@ -15,20 +15,36 @@ func _process(delta): 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 + print("hehe") func play_music(music):