generated from krampus/template-godot4
Beam sounds
This commit is contained in:
parent
03aff37ee7
commit
7fa75c3cf0
BIN
asset_dev/sfx/245942__sophiehall3535__electricity-static.wav
Normal file
BIN
asset_dev/sfx/245942__sophiehall3535__electricity-static.wav
Normal file
Binary file not shown.
Binary file not shown.
BIN
asset_dev/sfx/beam_loop.aup3
Normal file
BIN
asset_dev/sfx/beam_loop.aup3
Normal file
Binary file not shown.
BIN
asset_dev/sfx/beam_loop.aup3-shm
Normal file
BIN
asset_dev/sfx/beam_loop.aup3-shm
Normal file
Binary file not shown.
BIN
asset_dev/sfx/beam_loop.aup3-wal
Normal file
BIN
asset_dev/sfx/beam_loop.aup3-wal
Normal file
Binary file not shown.
BIN
assets/sfx/tools/beam_loop.wav
Normal file
BIN
assets/sfx/tools/beam_loop.wav
Normal file
Binary file not shown.
24
assets/sfx/tools/beam_loop.wav.import
Normal file
24
assets/sfx/tools/beam_loop.wav.import
Normal file
@ -0,0 +1,24 @@
|
||||
[remap]
|
||||
|
||||
importer="wav"
|
||||
type="AudioStreamWAV"
|
||||
uid="uid://pltp1s1x8q6u"
|
||||
path="res://.godot/imported/beam_loop.wav-e0261eabd9510078d8b64ea2e8c4efe8.sample"
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://assets/sfx/tools/beam_loop.wav"
|
||||
dest_files=["res://.godot/imported/beam_loop.wav-e0261eabd9510078d8b64ea2e8c4efe8.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=2
|
||||
edit/loop_begin=0
|
||||
edit/loop_end=-1
|
||||
compress/mode=2
|
@ -17,7 +17,7 @@
|
||||
[ext_resource type="ArrayMesh" uid="uid://bx00qgk2dyjrw" path="res://assets/level/wall/wall_2.mesh" id="16_sqa4l"]
|
||||
[ext_resource type="PackedScene" uid="uid://b6eg8t04rkh0c" path="res://src/props/wall_switch/wall_switch.tscn" id="17_0idgf"]
|
||||
[ext_resource type="Texture2D" uid="uid://dwi2opqp2s8ak" path="res://assets/level/wall/wall_1_R.png" id="17_smvh1"]
|
||||
[ext_resource type="PackedScene" uid="uid://2yqi5u5eo025" path="res://src/world/mechanics/alarm/grunk_nodule.tscn" id="19_ji5cn"]
|
||||
[ext_resource type="PackedScene" uid="uid://2yqi5u5eo025" path="res://src/world/gunk_node/grunk_nodule.tscn" id="19_ji5cn"]
|
||||
[ext_resource type="PackedScene" uid="uid://30o8ltnnxpxo" path="res://src/effects/floating_dust.tscn" id="25_6giaa"]
|
||||
[ext_resource type="ArrayMesh" uid="uid://cqd0a7ousx01n" path="res://assets/level/hallway/hallway_1.mesh" id="25_smvh1"]
|
||||
[ext_resource type="PackedScene" uid="uid://cppd3scvxf3eg" path="res://src/props/crate_long/crate_long.tscn" id="26_otfxe"]
|
||||
|
@ -12,7 +12,7 @@
|
||||
[ext_resource type="ArrayMesh" uid="uid://5jt7xxr05lw3" path="res://assets/level/hallway/hallway_2.mesh" id="8_hrvvi"]
|
||||
[ext_resource type="ArrayMesh" uid="uid://o6k7ebet848p" path="res://assets/level/hallway/hallway_3.mesh" id="9_2roq2"]
|
||||
[ext_resource type="PackedScene" uid="uid://b6eg8t04rkh0c" path="res://src/props/wall_switch/wall_switch.tscn" id="9_p27ol"]
|
||||
[ext_resource type="PackedScene" uid="uid://2yqi5u5eo025" path="res://src/world/mechanics/alarm/grunk_nodule.tscn" id="10_2roq2"]
|
||||
[ext_resource type="PackedScene" uid="uid://2yqi5u5eo025" path="res://src/world/gunk_node/grunk_nodule.tscn" id="10_2roq2"]
|
||||
[ext_resource type="PackedScene" uid="uid://d1kacn4b60ucy" path="res://src/ui/post_processing.tscn" id="11_6fwow"]
|
||||
|
||||
[sub_resource type="PlaneMesh" id="PlaneMesh_4afx3"]
|
||||
|
30
src/equipment/beam_sfx/beam_sfx.gd
Normal file
30
src/equipment/beam_sfx/beam_sfx.gd
Normal file
@ -0,0 +1,30 @@
|
||||
class_name BeamSFX extends AudioStreamPlayer3D
|
||||
## Audio player that pitches up each frame `activate` is called, and pitches down any other time.
|
||||
|
||||
const MAX_PITCH := 1.0
|
||||
const MIN_PITCH := 0.001
|
||||
|
||||
@export var pitch_increment := 3.236
|
||||
@export var pitch_decrement := 1.618
|
||||
|
||||
var _active_this_frame := false
|
||||
|
||||
|
||||
func activate() -> void:
|
||||
_active_this_frame = true
|
||||
if not playing:
|
||||
playing = true
|
||||
|
||||
|
||||
func _process(delta: float) -> void:
|
||||
if not playing:
|
||||
return
|
||||
|
||||
if _active_this_frame:
|
||||
pitch_scale = min(MAX_PITCH, pitch_scale + pitch_increment * delta)
|
||||
else:
|
||||
pitch_scale = max(MIN_PITCH, pitch_scale - pitch_decrement * delta)
|
||||
if pitch_scale <= MIN_PITCH:
|
||||
playing = false
|
||||
|
||||
_active_this_frame = false
|
1
src/equipment/beam_sfx/beam_sfx.gd.uid
Normal file
1
src/equipment/beam_sfx/beam_sfx.gd.uid
Normal file
@ -0,0 +1 @@
|
||||
uid://7mp6lj3f6srq
|
11
src/equipment/beam_sfx/beam_sfx.tscn
Normal file
11
src/equipment/beam_sfx/beam_sfx.tscn
Normal file
@ -0,0 +1,11 @@
|
||||
[gd_scene load_steps=3 format=3 uid="uid://5y7gcq6igjpf"]
|
||||
|
||||
[ext_resource type="AudioStream" uid="uid://pltp1s1x8q6u" path="res://assets/sfx/tools/beam_loop.wav" id="1_hbyr8"]
|
||||
[ext_resource type="Script" uid="uid://7mp6lj3f6srq" path="res://src/equipment/beam_sfx/beam_sfx.gd" id="2_qwosj"]
|
||||
|
||||
[node name="BeamSFX" type="AudioStreamPlayer3D"]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0)
|
||||
stream = ExtResource("1_hbyr8")
|
||||
pitch_scale = 0.01
|
||||
bus = &"SFX"
|
||||
script = ExtResource("2_qwosj")
|
25
src/equipment/beam_sfx_stream.tres
Normal file
25
src/equipment/beam_sfx_stream.tres
Normal file
@ -0,0 +1,25 @@
|
||||
[gd_resource type="AudioStreamInteractive" load_steps=2 format=3 uid="uid://dhuioidbjemkx"]
|
||||
|
||||
[ext_resource type="AudioStream" uid="uid://pltp1s1x8q6u" path="res://assets/sfx/tools/beam_loop.wav" id="1_h7js2"]
|
||||
|
||||
[resource]
|
||||
clip_count = 2
|
||||
clip_0/name = &"silence"
|
||||
clip_0/auto_advance = 0
|
||||
clip_1/name = &"Beam Loop"
|
||||
clip_1/stream = ExtResource("1_h7js2")
|
||||
clip_1/auto_advance = 0
|
||||
_transitions = {
|
||||
Vector2i(0, 1): {
|
||||
"fade_beats": 1.0,
|
||||
"fade_mode": 1,
|
||||
"from_time": 0,
|
||||
"to_time": 2
|
||||
},
|
||||
Vector2i(1, 0): {
|
||||
"fade_beats": 1.0,
|
||||
"fade_mode": 2,
|
||||
"from_time": 0,
|
||||
"to_time": 1
|
||||
}
|
||||
}
|
@ -1,6 +1,7 @@
|
||||
class_name PointSpray extends Spray
|
||||
## Simple single-point spraygun
|
||||
|
||||
|
||||
@export var spray_scale := 1.5
|
||||
@export var damage := 0.3334
|
||||
|
||||
|
@ -1,10 +1,11 @@
|
||||
[gd_scene load_steps=14 format=3 uid="uid://cc102xko0u6yj"]
|
||||
[gd_scene load_steps=15 format=3 uid="uid://cc102xko0u6yj"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://dngia2ldbccv7" path="res://src/equipment/point_spray/point_spray.gd" id="1_2yl2v"]
|
||||
[ext_resource type="Material" uid="uid://c00gndxoepuqh" path="res://assets/materials/laser_spray.tres" id="2_0pfy3"]
|
||||
[ext_resource type="Texture2D" uid="uid://bn0gcsy37ahto" path="res://assets/ui/hud/reticle_large.png" id="2_qcl8j"]
|
||||
[ext_resource type="PackedScene" uid="uid://b8vradbaw61ga" path="res://src/equipment/laser_cast/laser_cast.tscn" id="3_qmoff"]
|
||||
[ext_resource type="Script" uid="uid://b274q7uvn0cvp" path="res://src/ui/rumbler_3d.gd" id="5_k4cg5"]
|
||||
[ext_resource type="PackedScene" uid="uid://5y7gcq6igjpf" path="res://src/equipment/beam_sfx/beam_sfx.tscn" id="5_tpavj"]
|
||||
[ext_resource type="Script" uid="uid://dj2x7x5qkbym1" path="res://src/ui/canvas_projector.gd" id="6_h2fjt"]
|
||||
[ext_resource type="Texture2D" uid="uid://brcxorcpe2g56" path="res://assets/ui/hud/tools/point_sprayer.png" id="6_otnek"]
|
||||
|
||||
@ -96,6 +97,9 @@ texture_albedo = ExtResource("2_qcl8j")
|
||||
texture_emission = ExtResource("2_qcl8j")
|
||||
cull_mask = 1048573
|
||||
|
||||
[node name="BeamSFX" parent="Muzzle" instance=ExtResource("5_tpavj")]
|
||||
unique_name_in_owner = true
|
||||
|
||||
[node name="HUDTool" type="Node3D" parent="."]
|
||||
unique_name_in_owner = true
|
||||
|
||||
|
@ -8,6 +8,7 @@ const RUMBLE_DROPOFF = 0.8
|
||||
@onready var beam_particles_1: GPUParticles3D = %BeamParticles1
|
||||
@onready var beam_particles_2: GPUParticles3D = %BeamParticles2
|
||||
@onready var rumbler: Rumbler3D = %Rumbler
|
||||
@onready var beam_sfx: BeamSFX = %BeamSFX
|
||||
|
||||
|
||||
func _spray() -> void:
|
||||
@ -28,6 +29,8 @@ func _fire() -> void:
|
||||
beam_particles_1.emitting = true
|
||||
beam_particles_2.emitting = true
|
||||
|
||||
beam_sfx.activate()
|
||||
|
||||
|
||||
func _idle() -> void:
|
||||
spray_effect.visible = false
|
||||
|
@ -1,4 +1,4 @@
|
||||
[gd_scene load_steps=20 format=3 uid="uid://d2hnxr5l6w2x4"]
|
||||
[gd_scene load_steps=21 format=3 uid="uid://d2hnxr5l6w2x4"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://dv40fyim2g2fa" path="res://src/equipment/wide_spray/wide_spray.gd" id="1_ggkto"]
|
||||
[ext_resource type="Material" uid="uid://c00gndxoepuqh" path="res://assets/materials/laser_spray.tres" id="2_26efp"]
|
||||
@ -6,6 +6,7 @@
|
||||
[ext_resource type="PackedScene" uid="uid://b8vradbaw61ga" path="res://src/equipment/laser_cast/laser_cast.tscn" id="3_xahet"]
|
||||
[ext_resource type="Texture2D" uid="uid://carrggw6kp14w" path="res://assets/ui/hud/reticle_left.png" id="4_rotxf"]
|
||||
[ext_resource type="Texture2D" uid="uid://wp03nuwt8hp5" path="res://assets/ui/hud/reticle_right.png" id="5_xo3vu"]
|
||||
[ext_resource type="PackedScene" uid="uid://5y7gcq6igjpf" path="res://src/equipment/beam_sfx/beam_sfx.tscn" id="7_hv82w"]
|
||||
[ext_resource type="Script" uid="uid://b274q7uvn0cvp" path="res://src/ui/rumbler_3d.gd" id="7_ku0nd"]
|
||||
[ext_resource type="Script" uid="uid://dj2x7x5qkbym1" path="res://src/ui/canvas_projector.gd" id="8_j7ker"]
|
||||
[ext_resource type="Texture2D" uid="uid://dxjwpai3or1hw" path="res://assets/ui/hud/tools/wide_sprayer.png" id="9_8vo2h"]
|
||||
@ -257,6 +258,9 @@ local_coords = true
|
||||
process_material = SubResource("ParticleProcessMaterial_lyk2j")
|
||||
draw_pass_1 = SubResource("QuadMesh_trcry")
|
||||
|
||||
[node name="BeamSFX" parent="Muzzle" instance=ExtResource("7_hv82w")]
|
||||
unique_name_in_owner = true
|
||||
|
||||
[node name="HUDTool" type="Node3D" parent="."]
|
||||
unique_name_in_owner = true
|
||||
|
||||
|
@ -111,10 +111,8 @@ func _physics_process(delta: float) -> void:
|
||||
|
||||
# Input movement
|
||||
var input_dir := Input.get_vector("move_left", "move_right", "move_forward", "move_back")
|
||||
var direction := (
|
||||
(camera_pivot.global_basis * Vector3(input_dir.x, 0, input_dir.y) * Vector3(1, 0, 1))
|
||||
. normalized()
|
||||
)
|
||||
var rel_input := input_dir.rotated(-camera_pivot.global_rotation.y)
|
||||
var direction := Vector3(rel_input.x, 0, rel_input.y).normalized()
|
||||
var movement := direction * get_speed() * delta
|
||||
velocity.x += movement.x
|
||||
velocity.z += movement.z
|
||||
|
@ -58,6 +58,28 @@ tracks/2/keys = {
|
||||
"times": PackedFloat32Array(0)
|
||||
}
|
||||
|
||||
[sub_resource type="Animation" id="Animation_hja65"]
|
||||
resource_name = "footstep_sfx"
|
||||
loop_mode = 1
|
||||
step = 0.01
|
||||
tracks/0/type = "method"
|
||||
tracks/0/imported = false
|
||||
tracks/0/enabled = true
|
||||
tracks/0/path = NodePath("%FootstepController")
|
||||
tracks/0/interp = 1
|
||||
tracks/0/loop_wrap = true
|
||||
tracks/0/keys = {
|
||||
"times": PackedFloat32Array(0.35, 0.85),
|
||||
"transitions": PackedFloat32Array(1, 1),
|
||||
"values": [{
|
||||
"args": [],
|
||||
"method": &"play_footstep"
|
||||
}, {
|
||||
"args": [],
|
||||
"method": &"play_footstep"
|
||||
}]
|
||||
}
|
||||
|
||||
[sub_resource type="Animation" id="Animation_o822w"]
|
||||
resource_name = "head_bob"
|
||||
loop_mode = 1
|
||||
@ -96,28 +118,6 @@ tracks/2/keys = {
|
||||
"times": PackedFloat32Array(0)
|
||||
}
|
||||
|
||||
[sub_resource type="Animation" id="Animation_hja65"]
|
||||
resource_name = "footstep_sfx"
|
||||
loop_mode = 1
|
||||
step = 0.01
|
||||
tracks/0/type = "method"
|
||||
tracks/0/imported = false
|
||||
tracks/0/enabled = true
|
||||
tracks/0/path = NodePath("%FootstepController")
|
||||
tracks/0/interp = 1
|
||||
tracks/0/loop_wrap = true
|
||||
tracks/0/keys = {
|
||||
"times": PackedFloat32Array(0.35, 0.85),
|
||||
"transitions": PackedFloat32Array(1, 1),
|
||||
"values": [{
|
||||
"args": [],
|
||||
"method": &"play_footstep"
|
||||
}, {
|
||||
"args": [],
|
||||
"method": &"play_footstep"
|
||||
}]
|
||||
}
|
||||
|
||||
[sub_resource type="AnimationLibrary" id="AnimationLibrary_l271a"]
|
||||
_data = {
|
||||
&"RESET": SubResource("Animation_x42xx"),
|
||||
@ -142,7 +142,7 @@ animation = &"RESET"
|
||||
[sub_resource type="AnimationNodeTimeScale" id="AnimationNodeTimeScale_8ydov"]
|
||||
|
||||
[sub_resource type="AnimationNodeBlendTree" id="AnimationNodeBlendTree_ylhto"]
|
||||
graph_offset = Vector2(-331.385, 78.9745)
|
||||
graph_offset = Vector2(-33.7273, -38.6364)
|
||||
nodes/blend/node = SubResource("AnimationNodeBlend2_o822w")
|
||||
nodes/blend/position = Vector2(779, 166)
|
||||
nodes/bob_anim/node = SubResource("AnimationNodeAnimation_x42xx")
|
||||
@ -242,7 +242,7 @@ tree_root = SubResource("AnimationNodeBlendTree_ylhto")
|
||||
anim_player = NodePath("..")
|
||||
parameters/blend/blend_amount = 0.0
|
||||
parameters/sfx_add/add_amount = 1.0
|
||||
parameters/timescale/scale = 1.0
|
||||
parameters/timescale/scale = false
|
||||
script = ExtResource("7_x42xx")
|
||||
|
||||
[node name="CollisionShape3D" type="CollisionShape3D" parent="."]
|
||||
|
@ -1,8 +1,8 @@
|
||||
[gd_scene load_steps=7 format=4 uid="uid://2yqi5u5eo025"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://07t7yhijru8f" path="res://src/world/gunk_node/grunk_nodule.gd" id="1_smghl"]
|
||||
[ext_resource type="PackedScene" uid="uid://xlt78xc1tmkl" path="res://src/effects/grunk_splatter.tscn" id="2_3aedv"]
|
||||
[ext_resource type="Material" uid="uid://bmab6i16v748m" path="res://assets/materials/grunk_jittery.material" id="3_w5rj3"]
|
||||
[ext_resource type="Script" uid="uid://07t7yhijru8f" path="res://src/world/gunk_node/grunk_nodule.gd" id="1_iyr82"]
|
||||
[ext_resource type="PackedScene" uid="uid://xlt78xc1tmkl" path="res://src/effects/grunk_splatter.tscn" id="2_m8r0a"]
|
||||
[ext_resource type="Material" uid="uid://bmab6i16v748m" path="res://assets/materials/grunk_jittery.material" id="3_eu6j6"]
|
||||
|
||||
[sub_resource type="ArrayMesh" id="ArrayMesh_24j8i"]
|
||||
_surfaces = [{
|
||||
@ -26,7 +26,7 @@ _surfaces = [{
|
||||
"format": 34896613399,
|
||||
"index_count": 60,
|
||||
"index_data": PackedByteArray("AAABAAIAAwAEAAUABgAHAAgACQAKAAsADAANAA4ADwAQABEAEgATABQAFQAWABcAGAAZABoAGwAcAB0AHgAfACAAIQAiACMAJAAlACYAJwAoACkAKgArACwALQAuAC8AMAAxADIAMwA0ADUANgA3ADgAOQA6ADsA"),
|
||||
"material": ExtResource("3_w5rj3"),
|
||||
"material": ExtResource("3_eu6j6"),
|
||||
"name": "Icosphere",
|
||||
"primitive": 3,
|
||||
"uv_scale": Vector4(0, 0, 0, 0),
|
||||
@ -41,8 +41,8 @@ data = PackedVector3Array(0.7236, -0.4472, 0.5257, 0, -1, 0, -0.2764, -0.4472, 0
|
||||
|
||||
[node name="GrunkNodule" type="StaticBody3D"]
|
||||
collision_layer = 5
|
||||
script = ExtResource("1_smghl")
|
||||
splatter_scene = ExtResource("2_3aedv")
|
||||
script = ExtResource("1_iyr82")
|
||||
splatter_scene = ExtResource("2_m8r0a")
|
||||
durability = 3.0
|
||||
metadata/_custom_type_script = "uid://bypgxi0gy56yk"
|
||||
|
Loading…
x
Reference in New Issue
Block a user