generated from krampus/template-godot4
Tool sounds
This commit is contained in:
parent
c06925b937
commit
9fd0b76da5
BIN
assets/sfx/tools/tool_bonk_v0.wav
(Stored with Git LFS)
Normal file
BIN
assets/sfx/tools/tool_bonk_v0.wav
(Stored with Git LFS)
Normal file
Binary file not shown.
24
assets/sfx/tools/tool_bonk_v0.wav.import
Normal file
24
assets/sfx/tools/tool_bonk_v0.wav.import
Normal file
@ -0,0 +1,24 @@
|
||||
[remap]
|
||||
|
||||
importer="wav"
|
||||
type="AudioStreamWAV"
|
||||
uid="uid://bmj7v5freut2j"
|
||||
path="res://.godot/imported/tool_bonk_v0.wav-662ee3c75b5255488cc0ca3fc9cbf29f.sample"
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://assets/sfx/tools/tool_bonk_v0.wav"
|
||||
dest_files=["res://.godot/imported/tool_bonk_v0.wav-662ee3c75b5255488cc0ca3fc9cbf29f.sample"]
|
||||
|
||||
[params]
|
||||
|
||||
force/8_bit=false
|
||||
force/mono=false
|
||||
force/max_rate=false
|
||||
force/max_rate_hz=44100
|
||||
edit/trim=false
|
||||
edit/normalize=false
|
||||
edit/loop_mode=0
|
||||
edit/loop_begin=0
|
||||
edit/loop_end=-1
|
||||
compress/mode=2
|
BIN
assets/sfx/tools/tool_switch_v0.wav
(Stored with Git LFS)
Normal file
BIN
assets/sfx/tools/tool_switch_v0.wav
(Stored with Git LFS)
Normal file
Binary file not shown.
24
assets/sfx/tools/tool_switch_v0.wav.import
Normal file
24
assets/sfx/tools/tool_switch_v0.wav.import
Normal file
@ -0,0 +1,24 @@
|
||||
[remap]
|
||||
|
||||
importer="wav"
|
||||
type="AudioStreamWAV"
|
||||
uid="uid://c01y7jauf4spn"
|
||||
path="res://.godot/imported/tool_switch_v0.wav-09e36ef08e2a53d30eec9aecb7cf6679.sample"
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://assets/sfx/tools/tool_switch_v0.wav"
|
||||
dest_files=["res://.godot/imported/tool_switch_v0.wav-09e36ef08e2a53d30eec9aecb7cf6679.sample"]
|
||||
|
||||
[params]
|
||||
|
||||
force/8_bit=false
|
||||
force/mono=false
|
||||
force/max_rate=false
|
||||
force/max_rate_hz=44100
|
||||
edit/trim=false
|
||||
edit/normalize=false
|
||||
edit/loop_mode=0
|
||||
edit/loop_begin=0
|
||||
edit/loop_end=-1
|
||||
compress/mode=2
|
@ -1,4 +1,4 @@
|
||||
[gd_scene load_steps=68 format=3 uid="uid://bwe2jdmvinhqd"]
|
||||
[gd_scene load_steps=69 format=3 uid="uid://bwe2jdmvinhqd"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://buwh0g1ga2aka" path="res://src/player/player.gd" id="1_npueo"]
|
||||
[ext_resource type="Script" uid="uid://cx1yt0drthpw3" path="res://src/player/camera_controller.gd" id="2_veeqv"]
|
||||
@ -38,6 +38,7 @@
|
||||
[ext_resource type="Script" uid="uid://c5o1d2shq2qig" path="res://src/world/game_sound/game_sound_emitter.gd" id="31_wcxbk"]
|
||||
[ext_resource type="Script" uid="uid://b5loa2u6s5l5c" path="res://src/player/rigid_body_physics.gd" id="36_phdu6"]
|
||||
[ext_resource type="Script" uid="uid://dg55jdoyctdq6" path="res://src/game/tutorial/tutorial_timer.gd" id="38_evlgt"]
|
||||
[ext_resource type="AudioStream" uid="uid://c01y7jauf4spn" path="res://assets/sfx/tools/tool_switch_v0.wav" id="39_gsylq"]
|
||||
|
||||
[sub_resource type="Animation" id="Animation_x42xx"]
|
||||
length = 0.001
|
||||
@ -824,3 +825,9 @@ one_shot = true
|
||||
autostart = true
|
||||
script = ExtResource("38_evlgt")
|
||||
tutorial_key = &"game/tutorial/progress/move"
|
||||
|
||||
[node name="ToolSwitchSFX" type="AudioStreamPlayer" parent="."]
|
||||
unique_name_in_owner = true
|
||||
stream = ExtResource("39_gsylq")
|
||||
volume_db = -12.0
|
||||
pitch_scale = 1.2
|
||||
|
@ -5,6 +5,8 @@ class_name ToolMount extends Node3D
|
||||
|
||||
var _active: Tool
|
||||
|
||||
@onready var tool_switch_sfx: AudioStreamPlayer = %ToolSwitchSFX
|
||||
|
||||
|
||||
func _ready() -> void:
|
||||
set_active(initial_tool)
|
||||
@ -36,7 +38,7 @@ func get_active() -> Tool:
|
||||
## The tool should be a child of this mount.
|
||||
## If the tool is not unlocked and `force` is false, this will have no effect.
|
||||
func set_active(tool: Tool, force: bool = false) -> void:
|
||||
if not force and not tool.unlocked():
|
||||
if not force and (not tool.unlocked() or tool == _active):
|
||||
GlobalSFXManager.bonk.play()
|
||||
return
|
||||
|
||||
@ -49,6 +51,8 @@ func set_active(tool: Tool, force: bool = false) -> void:
|
||||
_active.on_equip()
|
||||
# TODO equip animation?
|
||||
|
||||
tool_switch_sfx.play()
|
||||
|
||||
|
||||
## Sets the active tool by index relative to the currently-active tool.
|
||||
##
|
||||
|
@ -1,4 +1,4 @@
|
||||
[gd_scene load_steps=20 format=3 uid="uid://dq1x21tq06dud"]
|
||||
[gd_scene load_steps=21 format=3 uid="uid://dq1x21tq06dud"]
|
||||
|
||||
[ext_resource type="Theme" uid="uid://b07fevr214mmr" path="res://src/ui/hud/hud_theme.tres" id="1_lirk3"]
|
||||
[ext_resource type="Script" uid="uid://lrsv0185bfu" path="res://src/ui/hud/player_hud.gd" id="2_j6lpx"]
|
||||
@ -10,6 +10,7 @@
|
||||
[ext_resource type="FontFile" uid="uid://oq8ue2qrfijg" path="res://assets/fonts/Silkscreen/Silkscreen-Regular.ttf" id="7_iwjh7"]
|
||||
[ext_resource type="PackedScene" uid="uid://bce8b2erx64vg" path="res://src/game/tutorial/tutorial.tscn" id="9_8np55"]
|
||||
[ext_resource type="Theme" uid="uid://doq7ay6f7dgfo" path="res://src/ui/menus/menu.theme" id="10_c1hvd"]
|
||||
[ext_resource type="AudioStream" uid="uid://bmj7v5freut2j" path="res://assets/sfx/tools/tool_bonk_v0.wav" id="11_bu2tv"]
|
||||
|
||||
[sub_resource type="Animation" id="Animation_iwjh7"]
|
||||
length = 0.001
|
||||
@ -25,6 +26,18 @@ tracks/0/keys = {
|
||||
"update": 0,
|
||||
"values": [Color(1, 1, 1, 0)]
|
||||
}
|
||||
tracks/1/type = "value"
|
||||
tracks/1/imported = false
|
||||
tracks/1/enabled = true
|
||||
tracks/1/path = NodePath("TankAlert/TankAlertBonkSFX:playing")
|
||||
tracks/1/interp = 1
|
||||
tracks/1/loop_wrap = true
|
||||
tracks/1/keys = {
|
||||
"times": PackedFloat32Array(0),
|
||||
"transitions": PackedFloat32Array(1),
|
||||
"update": 1,
|
||||
"values": [false]
|
||||
}
|
||||
|
||||
[sub_resource type="Animation" id="Animation_8np55"]
|
||||
resource_name = "tank_full_alert"
|
||||
@ -42,6 +55,18 @@ tracks/0/keys = {
|
||||
"update": 0,
|
||||
"values": [Color(1, 1, 1, 0), Color(1, 1, 1, 1), Color(1, 1, 1, 0), Color(1, 1, 1, 1), Color(1, 1, 1, 0), Color(1, 1, 1, 1), Color(1, 1, 1, 0)]
|
||||
}
|
||||
tracks/1/type = "value"
|
||||
tracks/1/imported = false
|
||||
tracks/1/enabled = true
|
||||
tracks/1/path = NodePath("TankAlert/TankAlertBonkSFX:playing")
|
||||
tracks/1/interp = 1
|
||||
tracks/1/loop_wrap = true
|
||||
tracks/1/keys = {
|
||||
"times": PackedFloat32Array(0),
|
||||
"transitions": PackedFloat32Array(1),
|
||||
"update": 1,
|
||||
"values": [true]
|
||||
}
|
||||
|
||||
[sub_resource type="AnimationLibrary" id="AnimationLibrary_c1hvd"]
|
||||
_data = {
|
||||
@ -383,6 +408,12 @@ libraries = {
|
||||
&"": SubResource("AnimationLibrary_c1hvd")
|
||||
}
|
||||
|
||||
[node name="TankAlertBonkSFX" type="AudioStreamPlayer" parent="AlertHUD/TankAlert"]
|
||||
stream = ExtResource("11_bu2tv")
|
||||
volume_db = -8.0
|
||||
pitch_scale = 0.5
|
||||
bus = &"SFX"
|
||||
|
||||
[node name="GrunkAlert" type="Control" parent="AlertHUD"]
|
||||
anchors_preset = 0
|
||||
offset_right = 40.0
|
||||
@ -429,10 +460,10 @@ anchor_left = 0.5
|
||||
anchor_top = 0.5
|
||||
anchor_right = 0.5
|
||||
anchor_bottom = 0.5
|
||||
offset_left = -19.7154
|
||||
offset_top = -19.6578
|
||||
offset_right = -19.7154
|
||||
offset_bottom = -19.6578
|
||||
offset_left = -21.8871
|
||||
offset_top = -18.1049
|
||||
offset_right = -21.8871
|
||||
offset_bottom = -18.1049
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
script = ExtResource("4_ud8na")
|
||||
|
Loading…
x
Reference in New Issue
Block a user