Skip to content

Commit

Permalink
Merge pull request #58 from tecMTST/audio-design
Browse files Browse the repository at this point in the history
Foi liberado o merge na reunião do dia 27/06/2024. Deus no comando. #Fé
  • Loading branch information
electricjokebox authored Jun 28, 2024
2 parents c2c7780 + 6a11f78 commit 248880d
Show file tree
Hide file tree
Showing 31 changed files with 157 additions and 47 deletions.
Binary file added projeto/elementos/audio/bgm/hub/hub-menu.wav
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
File renamed without changes.
Binary file not shown.
46 changes: 46 additions & 0 deletions projeto/elementos/audio/mixer/mixer.tres
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
[gd_resource type="AudioBusLayout" format=2]

[resource]
bus/0/volume_db = -5.04224
bus/1/name = "BGM"
bus/1/solo = false
bus/1/mute = false
bus/1/bypass_fx = false
bus/1/volume_db = -10.0741
bus/1/send = "SFX_GAME 2"
bus/2/name = "BGM Track"
bus/2/solo = false
bus/2/mute = false
bus/2/bypass_fx = false
bus/2/volume_db = 0.0
bus/2/send = "BGM"
bus/3/name = "BGM Aux"
bus/3/solo = false
bus/3/mute = false
bus/3/bypass_fx = false
bus/3/volume_db = -3.54298
bus/3/send = "BGM"
bus/4/name = "SFX"
bus/4/solo = false
bus/4/mute = false
bus/4/bypass_fx = false
bus/4/volume_db = 0.0
bus/4/send = "SFX_GAME 2"
bus/5/name = "SFX Menu"
bus/5/solo = false
bus/5/mute = false
bus/5/bypass_fx = false
bus/5/volume_db = 0.0
bus/5/send = "SFX"
bus/6/name = "SFX Player"
bus/6/solo = false
bus/6/mute = false
bus/6/bypass_fx = false
bus/6/volume_db = 0.0
bus/6/send = "SFX_GAME 2"
bus/7/name = "SFX Game"
bus/7/solo = false
bus/7/mute = false
bus/7/bypass_fx = false
bus/7/volume_db = 0.0
bus/7/send = "Master"
Binary file added projeto/elementos/audio/sfx/hub/hub-clique.wav
Binary file not shown.
Binary file added projeto/elementos/audio/sfx/hub/hub-slide.wav
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
File renamed without changes.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Empty file removed projeto/elementos/musica/.gitkeep
Empty file.
Binary file removed projeto/elementos/musica/bgm_vinheta.mp3
Binary file not shown.
Empty file removed projeto/elementos/som/.gitkeep
Empty file.
Binary file removed projeto/elementos/som/movimento_agua.wav
Binary file not shown.
4 changes: 4 additions & 0 deletions projeto/project.godot
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,10 @@ config/name="mtst-game-template"
run/main_scene="res://recursos/abertura/abertura.tscn"
config/icon="res://elementos/imagem/icon.png"

[audio]

default_bus_layout="res://elementos/audio/mixer/mixer.tres"

[autoload]

EnchenteEstadoDeJogo="*res://recursos/jogos/enchente/scripts/EnchenteEstadoDeJogo.gd"
Expand Down
16 changes: 10 additions & 6 deletions projeto/recursos/abertura/abertura.tscn
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
[ext_resource path="res://elementos/imagem/abertura/logo.png" type="Texture" id=1]
[ext_resource path="res://recursos/abertura/abertura.gd" type="Script" id=2]
[ext_resource path="res://recursos/feed_de_noticias/feed_de_noticia.tscn" type="PackedScene" id=3]
[ext_resource path="res://elementos/musica/bgm_vinheta.mp3" type="AudioStream" id=4]
[ext_resource path="res://elementos/audio/bgm/splash/splash-vinheta.wav" type="AudioStream" id=4]

[sub_resource type="Animation" id=2]
length = 0.001
tracks/0/type = "value"
tracks/0/path = NodePath("AudioStreamPlayer:playing")
tracks/0/path = NodePath("AudioStreamBGM:playing")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/imported = false
Expand Down Expand Up @@ -36,13 +36,13 @@ tracks/1/keys = {
resource_name = "abertura"
length = 4.0
tracks/0/type = "value"
tracks/0/path = NodePath("AudioStreamPlayer:playing")
tracks/0/path = NodePath("AudioStreamBGM:playing")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/keys = {
"times": PoolRealArray( -0.1, 0, 3 ),
"times": PoolRealArray( -0.1, 0.5, 3 ),
"transitions": PoolRealArray( 1, 1, 1 ),
"update": 1,
"values": [ false, true, false ]
Expand All @@ -69,7 +69,7 @@ proxima_cena = ExtResource( 3 )
[node name="ColorRect" type="ColorRect" parent="."]
anchor_right = 1.0
anchor_bottom = 1.0
color = Color( 0.878431, 0, 0, 1 )
color = Color( 0, 0, 0, 1 )

[node name="AnimationPlayer" type="AnimationPlayer" parent="."]
anims/RESET = SubResource( 2 )
Expand All @@ -91,5 +91,9 @@ texture = ExtResource( 1 )
expand = true
stretch_mode = 6

[node name="AudioStreamPlayer" type="AudioStreamPlayer" parent="."]
[node name="AudioStreamBGM" type="AudioStreamPlayer" parent="."]
stream = ExtResource( 4 )
bus = "BGM Track"
__meta__ = {
"_editor_description_": ""
}
27 changes: 27 additions & 0 deletions projeto/recursos/feed_de_noticias/AudioStreamEfeitos.gd
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
extends AudioStreamPlayer

#Array de Clipes de Audio:
onready var clipesSFX = {
"clique": preload ("res://elementos/audio/sfx/hub/hub-clique.wav"),
}

#Gatilhos de clique no botão:
func _on_coracaobotao_pressed():
stop()
stream = clipesSFX.clique
play()

func _on_SaibaMais_pressed():
stop()
stream = clipesSFX.clique
play()

func _on_SaibaMenos_pressed():
stop()
stream = clipesSFX.clique
play()

func _on_Jogar_pressed():
stop()
stream = clipesSFX.clique
play()
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
[gd_scene load_steps=28 format=2]
[gd_scene load_steps=29 format=2]

[ext_resource path="res://elementos/imagem/imgfeed/Group 7.png" type="Texture" id=1]
[ext_resource path="res://recursos/feed_de_noticias/SeletorDeNiveis/TemaSeletorDeLevel.tres" type="Theme" id=2]
[ext_resource path="res://elementos/scripts/ScriptsCartaoDeLevel/CartaoGeral.gd" type="Script" id=3]
[ext_resource path="res://recursos/feed_de_noticias/AudioStreamEfeitos.gd" type="Script" id=4]
[ext_resource path="res://elementos/imagem/imgfeed/Group 9.png" type="Texture" id=5]
[ext_resource path="res://elementos/imagem/imgfeed/coracao/Vector-1.png" type="Texture" id=6]
[ext_resource path="res://elementos/imagem/imgfeed/coracao/Vector-2.png" type="Texture" id=7]
Expand Down Expand Up @@ -460,7 +461,15 @@ root_node = NodePath("../../PainelPrincipal/Sparkles")
playback_speed = 1.4
"anims/Animação" = SubResource( 2 )

[node name="AudioStreamCartao" type="AudioStreamPlayer" parent="."]
bus = "SFX Menu"
script = ExtResource( 4 )

[connection signal="pressed" from="PainelPrincipal/Coracao/coracaobotao" to="ManuseadorDeAnimacoes" method="_on_coracaobotao_pressed"]
[connection signal="pressed" from="PainelPrincipal/Coracao/coracaobotao" to="AudioStreamCartao" method="_on_coracaobotao_pressed"]
[connection signal="pressed" from="PainelPrincipal/SaibaMais" to="ManuseadorDeAnimacoes" method="_on_SaibaMais_pressed"]
[connection signal="pressed" from="PainelPrincipal/SaibaMais" to="AudioStreamCartao" method="_on_SaibaMais_pressed"]
[connection signal="pressed" from="PainelDescricao/SaibaMenos" to="ManuseadorDeAnimacoes" method="_on_SaibaMenos_pressed"]
[connection signal="pressed" from="PainelDescricao/SaibaMenos" to="AudioStreamCartao" method="_on_SaibaMenos_pressed"]
[connection signal="pressed" from="PainelDescricao/Jogar" to="." method="_on_Jogar_pressed"]
[connection signal="pressed" from="PainelDescricao/Jogar" to="AudioStreamCartao" method="_on_Jogar_pressed"]
8 changes: 7 additions & 1 deletion projeto/recursos/feed_de_noticias/feed_de_noticia.tscn
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
[gd_scene load_steps=5 format=2]
[gd_scene load_steps=6 format=2]

[ext_resource path="res://recursos/feed_de_noticias/SeletorDeNiveis/cartao_de_noticia.tscn" type="PackedScene" id=1]
[ext_resource path="res://elementos/scripts/ScriptsCartaoDeLevel/VBoxResizer.gd" type="Script" id=2]
[ext_resource path="res://elementos/imagem/imgfeed/Group 14.png" type="Texture" id=3]
[ext_resource path="res://recursos/feed_de_noticias/SeletorDeNiveis/TemaSeletorDeLevel.tres" type="Theme" id=4]
[ext_resource path="res://elementos/audio/bgm/hub/hub-menu.wav" type="AudioStream" id=5]

[node name="FeedDeNoticias" type="Control"]
anchor_left = 0.5
Expand Down Expand Up @@ -109,3 +110,8 @@ margin_top = -164.17
margin_right = 360.0
margin_bottom = 163.83
color = Color( 1, 0.52549, 0.52549, 1 )

[node name="AudioStreamBGM" type="AudioStreamPlayer" parent="."]
stream = ExtResource( 5 )
autoplay = true
bus = "BGM Track"
19 changes: 16 additions & 3 deletions projeto/recursos/jogos/enchente/cenas/Enchente.tscn
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[gd_scene load_steps=19 format=2]
[gd_scene load_steps=21 format=2]

[ext_resource path="res://recursos/jogos/enchente/barra_de_progresso/BarraDeProgresso.tscn" type="PackedScene" id=1]
[ext_resource path="res://recursos/jogos/enchente/jogador/playerLane3D.tscn" type="PackedScene" id=2]
Expand All @@ -10,6 +10,8 @@
[ext_resource path="res://elementos/scripts/ScriptsBackgroundCidadeSubindo/cidadeSubindo.gd" type="Script" id=8]
[ext_resource path="res://elementos/modelos/skybox/skyboxNuvens.tscn" type="PackedScene" id=9]
[ext_resource path="res://elementos/imagem/enchente/background.png" type="Texture" id=10]
[ext_resource path="res://elementos/audio/bgm/minigame-1/amb-agua-corrente.wav" type="AudioStream" id=11]
[ext_resource path="res://elementos/audio/bgm/minigame-1/minigame-surf.wav" type="AudioStream" id=12]

[sub_resource type="GDScript" id=7]
script/source = "extends Spatial
Expand Down Expand Up @@ -198,6 +200,9 @@ transform = Transform( 1, 0, 0, 0, 0.949972, 0.312335, 0, -0.312335, 0.949972, 0
current = true
fov = 84.375
[node name="Listener" type="Listener" parent="Camera"]
current = true
[node name="Paredes" type="Spatial" parent="."]
[node name="CriadorPredios" parent="Paredes" instance=ExtResource( 5 )]
Expand Down Expand Up @@ -287,8 +292,6 @@ transform = Transform( 5.64013, 0, 0, 0, 7.65124, -1.10398, 0, 1.89858, 7.25025,
[node name="cidadesubindo" type="Spatial" parent="."]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, -70.8976 )
script = ExtResource( 8 )
tempoDeEsperaPrimeiraFase = 25
tempoDeEsperaSegundaFase = 25
[node name="SpriteCidade" type="Sprite3D" parent="cidadesubindo"]
transform = Transform( 1.89286, 0, 0.0185888, 0, 1.51988, 0, -0.16577, 0, 0.212257, -11, -15, 0 )
Expand All @@ -314,5 +317,15 @@ anims/reset = SubResource( 11 )
[node name="TimerDoTempoDeEspera" type="Timer" parent="cidadesubindo"]
[node name="AudioStreamAMB" type="AudioStreamPlayer" parent="."]
stream = ExtResource( 11 )
autoplay = true
bus = "BGM Aux"
[node name="AudioStreamBGM" type="AudioStreamPlayer" parent="."]
stream = ExtResource( 12 )
autoplay = true
bus = "BGM Track"
[connection signal="timeout" from="TimerObstaculos" to="." method="_on_TimerObstaculos_timeout"]
[connection signal="body_entered" from="AreaColetoraObstaculos" to="." method="_on_AreaColetoraObstaculos_body_entered"]
31 changes: 31 additions & 0 deletions projeto/recursos/jogos/enchente/jogador/AudioStreamPlayer.gd
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
extends AudioStreamPlayer

#Array de clipes de audio:
onready var clipesSFX = {
"trocaFaixa": [
preload ("res://elementos/audio/sfx/minigame-1/player-mov-1.wav"),
preload ("res://elementos/audio/sfx/minigame-1/player-mov-2.wav"),
preload ("res://elementos/audio/sfx/minigame-1/player-mov-3.wav"),
preload ("res://elementos/audio/sfx/minigame-1/player-mov-4.wav"),
],
"dano": [
preload ("res://elementos/audio/sfx/minigame-1/player-bolha-1.wav"),
preload ("res://elementos/audio/sfx/minigame-1/player-bolha-2.wav"),
]
}

#Gerador de número randômico:
var rng = RandomNumberGenerator.new()

#Gatilho de troca de faixa:
func _on_ControleFaixa3D_iniciou_movimento(_direcao, _alvo) -> void:
stop()
stream = clipesSFX.trocaFaixa[rng.randf_range(0, clipesSFX.trocaFaixa.size())]
play()

#Gatilho de vida alterada:
func _on_Vida_vida_alterada(alteracao: Vida.VidaAlterada) -> void:
if !alteracao.cura:
stop()
stream = clipesSFX.dano[rng.randf_range(0, clipesSFX.dano.size())]
play()
22 changes: 0 additions & 22 deletions projeto/recursos/jogos/enchente/jogador/Sons.gd

This file was deleted.

20 changes: 6 additions & 14 deletions projeto/recursos/jogos/enchente/jogador/playerLane3D.tscn
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
[gd_scene load_steps=10 format=2]
[gd_scene load_steps=8 format=2]

[ext_resource path="res://elementos/imagem/enchente/senhora.png" type="Texture" id=1]
[ext_resource path="res://addons/controles3D/ControleFaixa3D.gd" type="Script" id=2]
[ext_resource path="res://recursos/jogos/enchente/jogador/playerLane3D.gd" type="Script" id=3]
[ext_resource path="res://recursos/jogos/enchente/controlador_arrasta/ControladorArrasta.tscn" type="PackedScene" id=4]
[ext_resource path="res://addons/sistema_vida/vida.gd" type="Script" id=5]
[ext_resource path="res://elementos/musica/bgm_surf.wav" type="AudioStream" id=6]
[ext_resource path="res://elementos/som/movimento_agua.wav" type="AudioStream" id=7]
[ext_resource path="res://recursos/jogos/enchente/jogador/Sons.gd" type="Script" id=8]
[ext_resource path="res://recursos/jogos/enchente/jogador/AudioStreamPlayer.gd" type="Script" id=8]

[sub_resource type="SphereShape" id=1]

Expand Down Expand Up @@ -37,23 +35,17 @@ posicao_inicial = 1
script = ExtResource( 5 )
vida_maxima = 3.0

[node name="Musica" type="AudioStreamPlayer" parent="."]
stream = ExtResource( 6 )
volume_db = -15.0
autoplay = true

[node name="Sons" type="AudioStreamPlayer" parent="."]
stream = ExtResource( 7 )
[node name="AudioStreamPlayer" type="AudioStreamPlayer" parent="."]
bus = "SFX Player"
script = ExtResource( 8 )

[node name="AreaDano" type="Area" parent="."]

[node name="CollisionShape" type="CollisionShape" parent="AreaDano"]
shape = SubResource( 1 )

[connection signal="iniciou_movimento" from="ControleFaixa3D" to="Sons" method="_on_ControleFaixa3D_iniciou_movimento"]
[connection signal="terminou_movimento" from="ControleFaixa3D" to="Sons" method="_on_ControleFaixa3D_terminou_movimento"]
[connection signal="iniciou_movimento" from="ControleFaixa3D" to="AudioStreamPlayer" method="_on_ControleFaixa3D_iniciou_movimento"]
[connection signal="arrastado" from="ControladorArrasta" to="." method="_on_ControladorArrasta_arrastado"]
[connection signal="vida_acabou" from="Vida" to="." method="_on_Vida_vida_acabou"]
[connection signal="vida_alterada" from="Vida" to="Sons" method="_on_Vida_vida_alterada"]
[connection signal="vida_alterada" from="Vida" to="AudioStreamPlayer" method="_on_Vida_vida_alterada"]
[connection signal="body_entered" from="AreaDano" to="." method="_on_AreaDano_body_entered"]

0 comments on commit 248880d

Please sign in to comment.