Skip to content

Commit

Permalink
Add music
Browse files Browse the repository at this point in the history
  • Loading branch information
fiwon123 committed Oct 21, 2019
1 parent 889fe92 commit 05e179f
Show file tree
Hide file tree
Showing 7 changed files with 38 additions and 4 deletions.
Binary file added MetroidvaniaTCC/SFX/BRPG_Vanquisher_FULL_Loop.wav
Binary file not shown.
21 changes: 21 additions & 0 deletions MetroidvaniaTCC/SFX/BRPG_Vanquisher_FULL_Loop.wav.import
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
[remap]

importer="wav"
type="AudioStreamSample"
path="res://.import/BRPG_Vanquisher_FULL_Loop.wav-4bc8580d2b0674a5db22513d7e652c27.sample"

[deps]

source_file="res://SFX/BRPG_Vanquisher_FULL_Loop.wav"
dest_files=[ "res://.import/BRPG_Vanquisher_FULL_Loop.wav-4bc8580d2b0674a5db22513d7e652c27.sample" ]

[params]

force/8_bit=false
force/mono=false
force/max_rate=false
force/max_rate_hz=44100
edit/trim=true
edit/normalize=true
edit/loop=true
compress/mode=0
4 changes: 3 additions & 1 deletion MetroidvaniaTCC/Scenes/GUI/PanelMenu.gd
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,7 @@ func _on_ButtonResume_button_down():


func _on_ButtonExit_button_down():
get_tree().change_scene("res://Scenes/Screens/MainMenu.tscn")
get_tree().paused = false
Global.music.stop()
get_tree().change_scene("res://Scenes/Screens/MainMenu.tscn")

5 changes: 4 additions & 1 deletion MetroidvaniaTCC/Scenes/Global/Global.tscn
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
[gd_scene load_steps=2 format=2]
[gd_scene load_steps=3 format=2]

[ext_resource path="res://Scripts/Global.gd" type="Script" id=1]
[ext_resource path="res://SFX/BRPG_Vanquisher_FULL_Loop.wav" type="AudioStream" id=2]

[node name="Global" type="Node"]
script = ExtResource( 1 )

[node name="AudioStreamPlayer" type="AudioStreamPlayer" parent="."]
stream = ExtResource( 2 )
volume_db = -5.0

4 changes: 2 additions & 2 deletions MetroidvaniaTCC/Scenes/Levels/Level1.tscn
Original file line number Diff line number Diff line change
Expand Up @@ -1249,7 +1249,7 @@ x = 2

[node name="Sprite" parent="Barreiras/Barreira3" index="5"]
modulate = Color( 0.996078, 0.501961, 1, 1 )
frame = 0
frame = 2

[node name="Barreira4" parent="Barreiras" instance=ExtResource( 22 )]
editor/display_folded = true
Expand All @@ -1259,7 +1259,7 @@ x = 3

[node name="Sprite" parent="Barreiras/Barreira4" index="5"]
modulate = Color( 0.996078, 0.501961, 1, 1 )
frame = 0
frame = 2

[node name="ObjectsVila" type="Node2D" parent="."]
editor/display_folded = true
Expand Down
6 changes: 6 additions & 0 deletions MetroidvaniaTCC/Scripts/Game.gd
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ onready var anim_cutscene = $AnimationCutScenes

func _ready():
Global.game = self

if (Global.is_trigger1 == true):
Global.music.play()

func pause_animation():
$AnimationCutScenes.playback_process_mode = AnimationPlayer.ANIMATION_PROCESS_MANUAL
Expand Down Expand Up @@ -41,4 +44,7 @@ func showTutorialJump():
pass

func _on_AnimationCutScenes_animation_finished(anim_name):
if (anim_name == "cena1"):
Global.music.play()

is_stop = false
2 changes: 2 additions & 0 deletions MetroidvaniaTCC/Scripts/Global.gd
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
extends Node

onready var music = $AudioStreamPlayer

var dialogue
var GUI
var Camera2D
Expand Down

0 comments on commit 05e179f

Please sign in to comment.