Skip to content

Commit

Permalink
Added music to main level, and end music
Browse files Browse the repository at this point in the history
  • Loading branch information
antoniovalentic committed Sep 5, 2024
1 parent de5b6e4 commit e5a3d63
Show file tree
Hide file tree
Showing 17 changed files with 119 additions and 10 deletions.
15 changes: 14 additions & 1 deletion main-scene.tscn
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
[gd_scene load_steps=31 format=3 uid="uid://c4skaw306j3u5"]
[gd_scene load_steps=33 format=3 uid="uid://c4skaw306j3u5"]

[ext_resource type="Script" path="res://scripts/level_moon_surface.gd" id="1_1kkfo"]
[ext_resource type="PackedScene" uid="uid://bnyenue78c6u2" path="res://world_environment.tscn" id="1_bbcfy"]
[ext_resource type="Texture2D" uid="uid://5yilpmr5knkg" path="res://models/textures/moon_diffuse.png" id="1_dhvcg"]
[ext_resource type="PackedScene" uid="uid://bmij4p4w6dm17" path="res://models/moon_inverse_cylinder.glb" id="2_0yagk"]
[ext_resource type="AudioStream" uid="uid://c4t41gmxwwm8s" path="res://music/HorrorMytery.mp3" id="2_4o0vm"]
[ext_resource type="PackedScene" uid="uid://draq8rm82hgog" path="res://pause_menu.tscn" id="2_j7fpa"]
[ext_resource type="PackedScene" uid="uid://cwpo78f50wouh" path="res://player.tscn" id="2_m1uo0"]
[ext_resource type="AudioStream" uid="uid://b3587tu5ek0xn" path="res://music/Shattered-Mind_LoFi.mp3" id="3_368hf"]
[ext_resource type="PackedScene" uid="uid://cd4bjhn0qultm" path="res://small_health.tscn" id="4_eh8b4"]
[ext_resource type="PackedScene" uid="uid://crp46hafgqcwo" path="res://models/pyramid.glb" id="5_o1km6"]
[ext_resource type="PackedScene" uid="uid://d4nldq1x7vpsk" path="res://enemy.tscn" id="7_gah88"]
Expand Down Expand Up @@ -62,6 +64,17 @@ cap_bottom = false
[node name="Main" type="Node3D"]
script = ExtResource("1_1kkfo")

[node name="StartAudioStreamPlayer" type="AudioStreamPlayer" parent="."]
stream = ExtResource("2_4o0vm")
volume_db = -50.0
autoplay = true
parameters/looping = true

[node name="EndAudioStreamPlayer" type="AudioStreamPlayer" parent="."]
stream = ExtResource("3_368hf")
volume_db = -20.0
autoplay = true

[node name="PauseMenu" parent="." instance=ExtResource("2_j7fpa")]

[node name="WorldEnvironment" parent="." instance=ExtResource("1_bbcfy")]
Expand Down
2 changes: 1 addition & 1 deletion main_menu.tscn
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,4 @@ transform = Transform3D(-3.98763e-08, 0.409605, -0.912263, 1.79044e-08, 0.912263

[node name="AudioStreamPlayer" type="AudioStreamPlayer" parent="."]
stream = ExtResource("7_wyxo3")
volume_db = -20.0
volume_db = -30.0
Binary file added music/City-of-the-Disturbed_Looping.mp3
Binary file not shown.
19 changes: 19 additions & 0 deletions music/City-of-the-Disturbed_Looping.mp3.import
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
[remap]

importer="mp3"
type="AudioStreamMP3"
uid="uid://mr1iwbeiq5vb"
path="res://.godot/imported/City-of-the-Disturbed_Looping.mp3-def9e9457aebb86729a01bce7aa4f0b9.mp3str"

[deps]

source_file="res://music/City-of-the-Disturbed_Looping.mp3"
dest_files=["res://.godot/imported/City-of-the-Disturbed_Looping.mp3-def9e9457aebb86729a01bce7aa4f0b9.mp3str"]

[params]

loop=false
loop_offset=0
bpm=0
beat_count=0
bar_beats=4
Binary file added music/HorrorMytery.mp3
Binary file not shown.
19 changes: 19 additions & 0 deletions music/HorrorMytery.mp3.import
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
[remap]

importer="mp3"
type="AudioStreamMP3"
uid="uid://c4t41gmxwwm8s"
path="res://.godot/imported/HorrorMytery.mp3-f5d63d755350b00e93c8dfe15082289e.mp3str"

[deps]

source_file="res://music/HorrorMytery.mp3"
dest_files=["res://.godot/imported/HorrorMytery.mp3-f5d63d755350b00e93c8dfe15082289e.mp3str"]

[params]

loop=false
loop_offset=0
bpm=0
beat_count=0
bar_beats=4
12 changes: 12 additions & 0 deletions music/Music Credits.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
Horror Mytery by Rafael Krux:
https://freepd.com/horror.php

Written by Rafael Krux. Dark, ambient and spooky horror track. Suitable for those moments when you are wounded lying on the 20th floor of the ruined building and waiting for zombies to get you. This music is available for commercial and non-commercial purposes.
https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=GHP54JTH49Q9U



https://soundimage.org/attribution-info/
City-of-the-Disturbed_Looping by Eric Matyas
Shattered-Mind_LoFi by Eric Matyas
Surrealization_LoFi by Eric Matyas
Binary file added music/Shattered-Mind_LoFi.mp3
Binary file not shown.
19 changes: 19 additions & 0 deletions music/Shattered-Mind_LoFi.mp3.import
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
[remap]

importer="mp3"
type="AudioStreamMP3"
uid="uid://b3587tu5ek0xn"
path="res://.godot/imported/Shattered-Mind_LoFi.mp3-62379d2f6142a35490efd10da6311924.mp3str"

[deps]

source_file="res://music/Shattered-Mind_LoFi.mp3"
dest_files=["res://.godot/imported/Shattered-Mind_LoFi.mp3-62379d2f6142a35490efd10da6311924.mp3str"]

[params]

loop=false
loop_offset=0
bpm=0
beat_count=0
bar_beats=4
Binary file added music/Surrealization_LoFi.mp3
Binary file not shown.
19 changes: 19 additions & 0 deletions music/Surrealization_LoFi.mp3.import
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
[remap]

importer="mp3"
type="AudioStreamMP3"
uid="uid://dbhfen5fwxd2k"
path="res://.godot/imported/Surrealization_LoFi.mp3-0f9d3c922fe85856d1b243858c26c5ff.mp3str"

[deps]

source_file="res://music/Surrealization_LoFi.mp3"
dest_files=["res://.godot/imported/Surrealization_LoFi.mp3-0f9d3c922fe85856d1b243858c26c5ff.mp3str"]

[params]

loop=false
loop_offset=0
bpm=0
beat_count=0
bar_beats=4
6 changes: 3 additions & 3 deletions pause_menu.tscn
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,14 @@ anchor_left = 0.5
anchor_top = 0.5
anchor_right = 0.5
anchor_bottom = 0.5
offset_left = -253.0
offset_left = -394.0
offset_top = -257.0
offset_right = -153.0
offset_right = -236.0
offset_bottom = -234.0
grow_horizontal = 2
grow_vertical = 2
scale = Vector2(5, 5)
text = "Song of Luna"
text = "The Song of Luna"
label_settings = SubResource("LabelSettings_ahi5l")
horizontal_alignment = 1
vertical_alignment = 1
Expand Down
2 changes: 1 addition & 1 deletion player.tscn
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ transform = Transform3D(-1, 0, -1.50996e-07, 0, 1, 0, 1.50996e-07, 0, -1, 0.8649

[node name="Flashlight" type="SpotLight3D" parent="CameraPivot/Camera"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.386791, -0.306319, -3.38144e-08)
light_energy = 2.0
light_energy = 3.0
light_cull_mask = 4294443007
shadow_enabled = true
spot_range = 20.0
Expand Down
4 changes: 2 additions & 2 deletions resources/inventory/weapons/pgt_gun.tres
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@

[resource]
script = ExtResource("2_ekjnt")
name = "Test weapon"
description = "test weapon"
name = "PGT Gun"
description = "PGT welding gun"
item_type = 2
max_stack = 1
is_usable = true
Expand Down
2 changes: 1 addition & 1 deletion scripts/global.gd
Original file line number Diff line number Diff line change
Expand Up @@ -114,4 +114,4 @@ func _on_game_end():
Global.load_scene(current_scene, main_menu_scene)

var tween: Tween = get_tree().create_tween().bind_node(self).set_loops(1)
tween.tween_callback(callback).set_delay(5)
tween.tween_callback(callback).set_delay(10)
8 changes: 8 additions & 0 deletions scripts/level_moon_surface.gd
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,18 @@ extends Node3D
@onready var eye: Node3D = $MapLayout/Eye
@onready var pause_menu: PauseMenu = $PauseMenu

@onready var start_audio_player: AudioStreamPlayer = $StartAudioStreamPlayer
@onready var end_audio_player: AudioStreamPlayer = $EndAudioStreamPlayer

@onready var player_spawn_start: Node3D = $PlayerSpawnStart
@onready var player_spawn: Node3D = $HutExterior/PlayerSpawn

func _ready():
Global.set_current_scene(self)
eye.visible = false

end_audio_player.stream_paused = true

SignalBus.game_end.connect(_on_game_end)
pause_menu.resume_pressed.connect(_on_resume_button_pressed)
pause_menu.quit_pressed.connect(_on_quit_button_pressed)
Expand Down Expand Up @@ -48,4 +53,7 @@ func _on_quit_button_pressed():
Global.load_scene(self, Global.main_menu_scene)

func _on_game_end():
start_audio_player.autoplay = false
start_audio_player.stop()
end_audio_player.stream_paused = false
eye.visible = true
2 changes: 1 addition & 1 deletion world_environment.tscn
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,6 @@ environment = SubResource("Environment_iif2h")

[node name="DirectionalLight3D" type="DirectionalLight3D" parent="."]
transform = Transform3D(0.977574, 3.45309e-09, -0.210591, 0.210591, -4.23904e-08, 0.977574, -5.55139e-09, -1, -4.2167e-08, -400, 238, 0)
light_energy = 0.012
light_energy = 0.03
directional_shadow_mode = 0
sky_mode = 1

0 comments on commit e5a3d63

Please sign in to comment.