diff --git a/mini-game/ressources/sounds/drop_004.wav b/mini-game/ressources/sounds/drop_004.wav new file mode 100644 index 0000000..dd67f71 Binary files /dev/null and b/mini-game/ressources/sounds/drop_004.wav differ diff --git a/mini-game/ressources/sounds/drop_004.wav.import b/mini-game/ressources/sounds/drop_004.wav.import new file mode 100644 index 0000000..dbbfbf4 --- /dev/null +++ b/mini-game/ressources/sounds/drop_004.wav.import @@ -0,0 +1,21 @@ +[remap] + +importer="wav" +type="AudioStreamSample" +path="res://.import/drop_004.wav-885be4baf10db32694bc6a0533126d41.sample" + +[deps] + +source_file="res://mini-game/ressources/sounds/drop_004.wav" +dest_files=[ "res://.import/drop_004.wav-885be4baf10db32694bc6a0533126d41.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=false +compress/mode=0 diff --git a/mini-game/scenes/players/player.gd b/mini-game/scenes/players/player.gd index 0148fa7..ad152d4 100644 --- a/mini-game/scenes/players/player.gd +++ b/mini-game/scenes/players/player.gd @@ -33,6 +33,7 @@ onready var bonus_texture := $BonusControl/Sprite onready var bonus_tween := $BonusControl/Tween onready var bonus_timer := $BonusControl/Timer onready var jump_timer := $JumpTimer +onready var jump_stream := $AudioStreamPlayer signal hit() signal die() @@ -63,6 +64,7 @@ func _physics_process(delta): func _input(event: InputEvent): if player_enabled and state == RUN and event.is_action_pressed(jump_key): jump_timer.start() + jump_stream.play() pressing_jump = true state = JUMP elif event.is_action_released(jump_key): diff --git a/mini-game/scenes/players/player.tscn b/mini-game/scenes/players/player.tscn index a2f7887..157b07b 100644 --- a/mini-game/scenes/players/player.tscn +++ b/mini-game/scenes/players/player.tscn @@ -1,4 +1,4 @@ -[gd_scene load_steps=26 format=2] +[gd_scene load_steps=27 format=2] [ext_resource path="res://mini-game/ressources/sprites/player/dino/dino_run7.png" type="Texture" id=1] [ext_resource path="res://mini-game/ressources/sprites/player/dino/dino_run5.png" type="Texture" id=2] @@ -22,6 +22,7 @@ [ext_resource path="res://mini-game/ressources/sprites/player/man/7.png" type="Texture" id=20] [ext_resource path="res://mini-game/ressources/sprites/player/man/9_1.png" type="Texture" id=21] [ext_resource path="res://mini-game/ressources/sprites/plus1.png" type="Texture" id=22] +[ext_resource path="res://mini-game/ressources/sounds/drop_004.wav" type="AudioStream" id=23] [sub_resource type="SpriteFrames" id=1] animations = [ { @@ -88,6 +89,9 @@ wait_time = 1.5 [node name="JumpTimer" type="Timer" parent="."] one_shot = true +[node name="AudioStreamPlayer" type="AudioStreamPlayer" parent="."] +stream = ExtResource( 23 ) + [connection signal="body_entered" from="Area2D" to="." method="_on_Area2D_body_entered"] [connection signal="body_exited" from="Area2D" to="." method="_on_Area2D_body_exited"] [connection signal="timeout" from="BonusControl/Timer" to="." method="_on_Timer_timeout"]