Sound added

This commit is contained in:
PfandBoss
2022-12-10 23:27:14 +01:00
parent a118fad15e
commit cd6cd181d2
5 changed files with 18 additions and 4 deletions

View File

@@ -1,4 +1,4 @@
[gd_scene load_steps=22 format=3 uid="uid://md2ofbviios3"] [gd_scene load_steps=23 format=3 uid="uid://md2ofbviios3"]
[ext_resource type="Script" path="res://scripts/Train.gd" id="1_0x664"] [ext_resource type="Script" path="res://scripts/Train.gd" id="1_0x664"]
[ext_resource type="PackedScene" uid="uid://bhivunrkj87cy" path="res://Nodes/engine.tscn" id="3_1ix85"] [ext_resource type="PackedScene" uid="uid://bhivunrkj87cy" path="res://Nodes/engine.tscn" id="3_1ix85"]
@@ -16,6 +16,7 @@
[ext_resource type="Texture2D" uid="uid://ckdlv6b7okseq" path="res://walking_powder2.png" id="10_a137a"] [ext_resource type="Texture2D" uid="uid://ckdlv6b7okseq" path="res://walking_powder2.png" id="10_a137a"]
[ext_resource type="Texture2D" uid="uid://b5ioch3ad8y6r" path="res://walking_coal2.png" id="11_1jgcf"] [ext_resource type="Texture2D" uid="uid://b5ioch3ad8y6r" path="res://walking_coal2.png" id="11_1jgcf"]
[ext_resource type="PackedScene" uid="uid://bkpnrgcfr1jgl" path="res://Nodes/Bin.tscn" id="16_q3kvk"] [ext_resource type="PackedScene" uid="uid://bkpnrgcfr1jgl" path="res://Nodes/Bin.tscn" id="16_q3kvk"]
[ext_resource type="AudioStream" uid="uid://b52sd64x20ulv" path="res://Assets/Sounds/_SOUNDFX_/Gunpowder.wav" id="17_ajifv"]
[sub_resource type="BoxShape3D" id="BoxShape3D_okaqh"] [sub_resource type="BoxShape3D" id="BoxShape3D_okaqh"]
size = Vector3(1, 3.77669, 24) size = Vector3(1, 3.77669, 24)
@@ -138,3 +139,4 @@ transform = Transform3D(-4.37114e-08, 0, 1, 0, 1, 0, -1, 0, -4.37114e-08, 0.7029
[node name="Storage3" parent="." instance=ExtResource("4_5jw5g")] [node name="Storage3" parent="." instance=ExtResource("4_5jw5g")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -4.63306, -0.501894, -11.5457) transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -4.63306, -0.501894, -11.5457)
currentType = 1 currentType = 1
audioClip = ExtResource("17_ajifv")

View File

@@ -1,4 +1,4 @@
[gd_scene load_steps=23 format=3 uid="uid://bikdn7ep2vpxw"] [gd_scene load_steps=24 format=3 uid="uid://bikdn7ep2vpxw"]
[ext_resource type="Script" path="res://scripts/Train.gd" id="1_mcmgl"] [ext_resource type="Script" path="res://scripts/Train.gd" id="1_mcmgl"]
[ext_resource type="PackedScene" uid="uid://c1mymb38wqdg6" path="res://Nodes/train.tscn" id="2_xoa1a"] [ext_resource type="PackedScene" uid="uid://c1mymb38wqdg6" path="res://Nodes/train.tscn" id="2_xoa1a"]
@@ -17,6 +17,7 @@
[ext_resource type="PackedScene" uid="uid://byo1m0n20yl45" path="res://Nodes/cannon.tscn" id="15_sof53"] [ext_resource type="PackedScene" uid="uid://byo1m0n20yl45" path="res://Nodes/cannon.tscn" id="15_sof53"]
[ext_resource type="PackedScene" uid="uid://cet80w4yr8rse" path="res://Storage.tscn" id="16_7dojn"] [ext_resource type="PackedScene" uid="uid://cet80w4yr8rse" path="res://Storage.tscn" id="16_7dojn"]
[ext_resource type="PackedScene" uid="uid://bhivunrkj87cy" path="res://Nodes/engine.tscn" id="17_regf7"] [ext_resource type="PackedScene" uid="uid://bhivunrkj87cy" path="res://Nodes/engine.tscn" id="17_regf7"]
[ext_resource type="AudioStream" uid="uid://b52sd64x20ulv" path="res://Assets/Sounds/_SOUNDFX_/Gunpowder.wav" id="17_xnc4h"]
[sub_resource type="BoxShape3D" id="BoxShape3D_dijw3"] [sub_resource type="BoxShape3D" id="BoxShape3D_dijw3"]
size = Vector3(1, 3.77669, 24) size = Vector3(1, 3.77669, 24)
@@ -136,6 +137,7 @@ currentType = 1
[node name="Storage3" parent="." instance=ExtResource("16_7dojn")] [node name="Storage3" parent="." instance=ExtResource("16_7dojn")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 4.79878, 0.293261, 6.13508) transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 4.79878, 0.293261, 6.13508)
currentType = 2 currentType = 2
audioClip = ExtResource("17_xnc4h")
[node name="Engine" parent="." instance=ExtResource("17_regf7")] [node name="Engine" parent="." instance=ExtResource("17_regf7")]
transform = Transform3D(2, 0, 0, 0, 2, 0, 0, 0, 2, 2.86451, 1.17834, 10.1923) transform = Transform3D(2, 0, 0, 0, 2, 0, 0, 0, 2, 2.86451, 1.17834, 10.1923)

View File

@@ -1,4 +1,4 @@
[gd_scene load_steps=9 format=3 uid="uid://db0pxwq1hvs45"] [gd_scene load_steps=10 format=3 uid="uid://db0pxwq1hvs45"]
[ext_resource type="Script" path="res://scripts/Logic/Game.gd" id="1_iox18"] [ext_resource type="Script" path="res://scripts/Logic/Game.gd" id="1_iox18"]
[ext_resource type="PackedScene" uid="uid://bqe8ucbruto1j" path="res://Nodes/StartNode.tscn" id="2_61aog"] [ext_resource type="PackedScene" uid="uid://bqe8ucbruto1j" path="res://Nodes/StartNode.tscn" id="2_61aog"]
@@ -8,6 +8,7 @@
[ext_resource type="PackedScene" uid="uid://bikdn7ep2vpxw" path="res://Nodes/Train_P2.tscn" id="4_lmu0s"] [ext_resource type="PackedScene" uid="uid://bikdn7ep2vpxw" path="res://Nodes/Train_P2.tscn" id="4_lmu0s"]
[ext_resource type="AudioStream" uid="uid://c5jhukuk8r3mf" path="res://Assets/Sounds/_MUSIC_/GameJamGameLoop.wav" id="7_0yxka"] [ext_resource type="AudioStream" uid="uid://c5jhukuk8r3mf" path="res://Assets/Sounds/_MUSIC_/GameJamGameLoop.wav" id="7_0yxka"]
[ext_resource type="AudioStream" uid="uid://n4ynf7hg2pcl" path="res://Assets/Sounds/_SOUNDFX_/GleiseLoop.wav" id="8_4y7wx"] [ext_resource type="AudioStream" uid="uid://n4ynf7hg2pcl" path="res://Assets/Sounds/_SOUNDFX_/GleiseLoop.wav" id="8_4y7wx"]
[ext_resource type="AudioStream" uid="uid://dovvnflvxtqpi" path="res://Assets/Sounds/_SOUNDFX_/WindLoop.wav" id="9_ip7lg"]
[node name="Game" type="Node"] [node name="Game" type="Node"]
script = ExtResource("1_iox18") script = ExtResource("1_iox18")
@@ -44,3 +45,8 @@ autoplay = true
stream = ExtResource("8_4y7wx") stream = ExtResource("8_4y7wx")
volume_db = -10.0 volume_db = -10.0
autoplay = true autoplay = true
[node name="AudioStreamPlayer3" type="AudioStreamPlayer" parent="."]
stream = ExtResource("9_ip7lg")
volume_db = -2.476
autoplay = true

View File

@@ -18,3 +18,5 @@ shape = SubResource("CylinderShape3D_c1ipa")
[node name="Sprite3D" type="Sprite3D" parent="."] [node name="Sprite3D" type="Sprite3D" parent="."]
transform = Transform3D(1, 0, 0, 0, -4.37114e-08, 1, 0, -1, -4.37114e-08, 0, 2, 0) transform = Transform3D(1, 0, 0, 0, -4.37114e-08, 1, 0, -1, -4.37114e-08, 0, 2, 0)
texture = ExtResource("2_a5kei") texture = ExtResource("2_a5kei")
[node name="AudioStreamPlayer" type="AudioStreamPlayer" parent="."]

View File

@@ -8,18 +8,20 @@ enum TYPE {AMMO, GUNPOWDER, COAL}
@export var currentType: TYPE @export var currentType: TYPE
@export var audioClip : AudioStreamWAV
#------------Methods-------------# #------------Methods-------------#
func _ready(): func _ready():
var root = get_tree().root.get_child(0) var root = get_tree().root.get_child(0)
#root.ammo_pickup.connect(_on_signal_storing) #root.ammo_pickup.connect(_on_signal_storing)
maxStashValue = 10 maxStashValue = 10
currentStashValue = 10 currentStashValue = 10
$AudioStreamPlayer.stream = audioClip
func interact(player): func interact(player):
if currentStashValue >= 1: if currentStashValue >= 1:
currentStashValue -= 1 currentStashValue -= 1
player.fill_inventory(currentType) player.fill_inventory(currentType)
$AudioStreamPlayer.play()
return return
func _on_signal_storing(): func _on_signal_storing():