add jumping sound

This commit is contained in:
2025-10-21 20:28:54 +01:00
parent cb0721103a
commit a1b28ee5d3
2 changed files with 50 additions and 1 deletions

View File

@@ -1,7 +1,8 @@
[gd_scene load_steps=26 format=3 uid="uid://3wumh6kpw3ai"]
[gd_scene load_steps=30 format=3 uid="uid://3wumh6kpw3ai"]
[ext_resource type="Texture2D" uid="uid://pc081i405fo4" path="res://assets/sprites/knight.png" id="1_3vyb7"]
[ext_resource type="Script" uid="uid://dkpsredq14h2l" path="res://scripts/player.gd" id="1_g2els"]
[ext_resource type="AudioStream" uid="uid://bkby1mto2lk2a" path="res://assets/sounds/jump.wav" id="3_qhqgy"]
[sub_resource type="AtlasTexture" id="AtlasTexture_g2els"]
atlas = ExtResource("1_3vyb7")
@@ -171,6 +172,43 @@ animations = [{
[sub_resource type="CircleShape2D" id="CircleShape2D_fjrip"]
radius = 5.0
[sub_resource type="Animation" id="Animation_dqkch"]
resource_name = "jump"
length = 0.2
tracks/0/type = "value"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath("Jump:playing")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 1,
"values": [true]
}
[sub_resource type="Animation" id="Animation_qlg0r"]
length = 0.001
tracks/0/type = "value"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath("Jump:playing")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 1,
"values": [false]
}
[sub_resource type="AnimationLibrary" id="AnimationLibrary_tuyoq"]
_data = {
&"RESET": SubResource("Animation_qlg0r"),
&"jump": SubResource("Animation_dqkch")
}
[node name="Player" type="CharacterBody2D"]
z_index = 5
collision_layer = 2
@@ -187,3 +225,12 @@ autoplay = "idle"
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
position = Vector2(0, -5)
shape = SubResource("CircleShape2D_fjrip")
[node name="Jump" type="AudioStreamPlayer2D" parent="."]
stream = ExtResource("3_qhqgy")
bus = &"SFX"
[node name="AnimationPlayer" type="AnimationPlayer" parent="."]
libraries = {
&"": SubResource("AnimationLibrary_tuyoq")
}