added Footsteps

This commit is contained in:
SyntaX 2019-11-23 13:17:11 +01:00
parent d779bbe8c6
commit 8fac603009
4 changed files with 79 additions and 2 deletions

View File

@ -0,0 +1,11 @@
extends Spatial
onready var steps = [
get_node("Footstep")
]
func play_footstep():
#Logger.trace("Footstep")
steps[0].play()

View File

@ -1,9 +1,44 @@
[gd_scene load_steps=3 format=2]
[gd_scene load_steps=6 format=2]
[ext_resource path="res://Player/Player.gd" type="Script" id=1]
[ext_resource path="res://Player/Footsteps.gd" type="Script" id=2]
[ext_resource path="res://Resources/Audio/Step.wav" type="AudioStream" id=3]
[sub_resource type="CylinderShape" id=1]
[sub_resource type="Animation" id=2]
resource_name = "Walk"
loop = true
tracks/0/type = "value"
tracks/0/path = NodePath("Camera:translation")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/keys = {
"times": PoolRealArray( 0, 0.2, 0.4, 0.6 ),
"transitions": PoolRealArray( 1, 1, 1, 1 ),
"update": 0,
"values": [ Vector3( 0, 0.8, 0 ), Vector3( -0.1, 0.9, 0 ), Vector3( 0, 0.8, 0 ), Vector3( 0.1, 0.9, 0 ) ]
}
tracks/1/type = "method"
tracks/1/path = NodePath("Footsteps")
tracks/1/interp = 1
tracks/1/loop_wrap = true
tracks/1/imported = false
tracks/1/enabled = true
tracks/1/keys = {
"times": PoolRealArray( 0, 0.5 ),
"transitions": PoolRealArray( 1, 1 ),
"values": [ {
"args": [ ],
"method": "play_footstep"
}, {
"args": [ ],
"method": "play_footstep"
} ]
}
[node name="Spatial" type="KinematicBody"]
script = ExtResource( 1 )
body_nodepath = NodePath("Body")
@ -14,14 +49,24 @@ camera_nodepath = NodePath("Camera")
[node name="Body" type="Spatial" parent="."]
[node name="Camera" type="Camera" parent="."]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 0 )
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0.0332799, 0.83328, 0 )
[node name="Collider" type="CollisionShape" parent="."]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 0 )
shape = SubResource( 1 )
[node name="WalkAnimationPlayer" type="AnimationPlayer" parent="."]
autoplay = "Walk"
anims/Walk = SubResource( 2 )
[node name="HUD" type="Control" parent="."]
margin_right = 40.0
margin_bottom = 40.0
[node name="Footsteps" type="Spatial" parent="."]
script = ExtResource( 2 )
[node name="Footstep" type="AudioStreamPlayer3D" parent="Footsteps"]
stream = ExtResource( 3 )
unit_db = -25.0
pitch_scale = 1.5

Binary file not shown.

View File

@ -0,0 +1,21 @@
[remap]
importer="wav"
type="AudioStreamSample"
path="res://.import/Step.wav-7d0ddf0513d871cbc1043ef07a7bc4cb.sample"
[deps]
source_file="res://Resources/Audio/Step.wav"
dest_files=[ "res://.import/Step.wav-7d0ddf0513d871cbc1043ef07a7bc4cb.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=false
compress/mode=0