Browse Source

add jump sound

Arnaud Vergnet 4 months ago
parent
commit
51341019b2

BIN
mini-game/ressources/sounds/drop_004.wav View File


+ 21
- 0
mini-game/ressources/sounds/drop_004.wav.import View File

@@ -0,0 +1,21 @@
1
+[remap]
2
+
3
+importer="wav"
4
+type="AudioStreamSample"
5
+path="res://.import/drop_004.wav-885be4baf10db32694bc6a0533126d41.sample"
6
+
7
+[deps]
8
+
9
+source_file="res://mini-game/ressources/sounds/drop_004.wav"
10
+dest_files=[ "res://.import/drop_004.wav-885be4baf10db32694bc6a0533126d41.sample" ]
11
+
12
+[params]
13
+
14
+force/8_bit=false
15
+force/mono=false
16
+force/max_rate=false
17
+force/max_rate_hz=44100
18
+edit/trim=false
19
+edit/normalize=false
20
+edit/loop=false
21
+compress/mode=0

+ 2
- 0
mini-game/scenes/players/player.gd View File

@@ -33,6 +33,7 @@ onready var bonus_texture := $BonusControl/Sprite
33 33
 onready var bonus_tween := $BonusControl/Tween
34 34
 onready var bonus_timer := $BonusControl/Timer
35 35
 onready var jump_timer := $JumpTimer
36
+onready var jump_stream := $AudioStreamPlayer
36 37
 
37 38
 signal hit()
38 39
 signal die()
@@ -63,6 +64,7 @@ func _physics_process(delta):
63 64
 func _input(event: InputEvent):
64 65
 	if player_enabled and state == RUN and event.is_action_pressed(jump_key):
65 66
 			jump_timer.start()
67
+			jump_stream.play()
66 68
 			pressing_jump = true
67 69
 			state = JUMP
68 70
 	elif event.is_action_released(jump_key):

+ 5
- 1
mini-game/scenes/players/player.tscn View File

@@ -1,4 +1,4 @@
1
-[gd_scene load_steps=26 format=2]
1
+[gd_scene load_steps=27 format=2]
2 2
 
3 3
 [ext_resource path="res://mini-game/ressources/sprites/player/dino/dino_run7.png" type="Texture" id=1]
4 4
 [ext_resource path="res://mini-game/ressources/sprites/player/dino/dino_run5.png" type="Texture" id=2]
@@ -22,6 +22,7 @@
22 22
 [ext_resource path="res://mini-game/ressources/sprites/player/man/7.png" type="Texture" id=20]
23 23
 [ext_resource path="res://mini-game/ressources/sprites/player/man/9_1.png" type="Texture" id=21]
24 24
 [ext_resource path="res://mini-game/ressources/sprites/plus1.png" type="Texture" id=22]
25
+[ext_resource path="res://mini-game/ressources/sounds/drop_004.wav" type="AudioStream" id=23]
25 26
 
26 27
 [sub_resource type="SpriteFrames" id=1]
27 28
 animations = [ {
@@ -88,6 +89,9 @@ wait_time = 1.5
88 89
 [node name="JumpTimer" type="Timer" parent="."]
89 90
 one_shot = true
90 91
 
92
+[node name="AudioStreamPlayer" type="AudioStreamPlayer" parent="."]
93
+stream = ExtResource( 23 )
94
+
91 95
 [connection signal="body_entered" from="Area2D" to="." method="_on_Area2D_body_entered"]
92 96
 [connection signal="body_exited" from="Area2D" to="." method="_on_Area2D_body_exited"]
93 97
 [connection signal="timeout" from="BonusControl/Timer" to="." method="_on_Timer_timeout"]

Loading…
Cancel
Save