add gavel sound
This commit is contained in:
parent
832565d28a
commit
2be7d477fe
4 changed files with 34 additions and 2 deletions
BIN
assets/gavel/audio/gavel.wav
Normal file
BIN
assets/gavel/audio/gavel.wav
Normal file
Binary file not shown.
24
assets/gavel/audio/gavel.wav.import
Normal file
24
assets/gavel/audio/gavel.wav.import
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
[remap]
|
||||
|
||||
importer="wav"
|
||||
type="AudioStreamWAV"
|
||||
uid="uid://biyqgj25si2ei"
|
||||
path="res://.godot/imported/gavel.wav-d4bde5ab631cfe5dc6af9c2040fe18c7.sample"
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://assets/gavel/audio/gavel.wav"
|
||||
dest_files=["res://.godot/imported/gavel.wav-d4bde5ab631cfe5dc6af9c2040fe18c7.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=0
|
||||
edit/loop_begin=0
|
||||
edit/loop_end=-1
|
||||
compress/mode=2
|
||||
|
|
@ -1,10 +1,11 @@
|
|||
[gd_scene load_steps=30 format=3 uid="uid://bohp0o2smdkwe"]
|
||||
[gd_scene load_steps=31 format=3 uid="uid://bohp0o2smdkwe"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://c2mrlu8d75ry4" path="res://gavel.gd" id="1_ep8l3"]
|
||||
[ext_resource type="Script" uid="uid://d2ophrxm0wtr6" path="res://desk.gd" id="1_yugeg"]
|
||||
[ext_resource type="Script" uid="uid://l7wiwo13pb0f" path="res://numpad.gd" id="2_t5y75"]
|
||||
[ext_resource type="PackedScene" uid="uid://d0iltvfnuao1q" path="res://NumpadButton.tscn" id="3_se7ci"]
|
||||
[ext_resource type="Texture2D" uid="uid://cepssq6wpywy5" path="res://assets/numpad/zero.png" id="4_tm3w8"]
|
||||
[ext_resource type="AudioStream" uid="uid://biyqgj25si2ei" path="res://assets/gavel/audio/gavel.wav" id="5_ky68s"]
|
||||
[ext_resource type="Texture2D" uid="uid://wkwpo1utjk0q" path="res://assets/numpad/background.png" id="5_r8wvv"]
|
||||
[ext_resource type="Texture2D" uid="uid://bci1ygp5qx7r0" path="res://assets/numpad/zero-depressed.png" id="6_d0do2"]
|
||||
[ext_resource type="Texture2D" uid="uid://cgrl7q65xeb7d" path="res://assets/numpad/one.png" id="7_yugeg"]
|
||||
|
|
@ -38,9 +39,10 @@ offset_bottom = 720.0
|
|||
script = ExtResource("1_yugeg")
|
||||
numpad = NodePath("Numpad")
|
||||
|
||||
[node name="Gavel" type="Node2D" parent="."]
|
||||
[node name="Gavel" type="Node2D" parent="." node_paths=PackedStringArray("audio_player")]
|
||||
position = Vector2(971, 563)
|
||||
script = ExtResource("1_ep8l3")
|
||||
audio_player = NodePath("GavelAudioPlayer")
|
||||
|
||||
[node name="TextureButton" type="TextureButton" parent="Gavel"]
|
||||
offset_right = 40.0
|
||||
|
|
@ -48,6 +50,9 @@ offset_bottom = 40.0
|
|||
texture_normal = ExtResource("25_3ueqa")
|
||||
texture_pressed = ExtResource("26_e06cl")
|
||||
|
||||
[node name="GavelAudioPlayer" type="AudioStreamPlayer2D" parent="Gavel"]
|
||||
stream = ExtResource("5_ky68s")
|
||||
|
||||
[node name="Numpad" type="Node2D" parent="." node_paths=PackedStringArray("progress_bar")]
|
||||
position = Vector2(640, 570)
|
||||
script = ExtResource("2_t5y75")
|
||||
|
|
|
|||
3
gavel.gd
3
gavel.gd
|
|
@ -6,7 +6,9 @@ var swinging
|
|||
var click_radius = 32 # will need to determine click radius based on sprite size -- should be equal
|
||||
var swing_threshold = 64 # will also need to scale this based on sprite size
|
||||
var swing_start = Vector2(0, 0)
|
||||
|
||||
@export var gavel_root_position = Vector2(0, 0)
|
||||
@export var audio_player: AudioStreamPlayer2D
|
||||
|
||||
#func _input(event: InputEvent) -> void:
|
||||
#if event is InputEventMouseButton and event.button_index == MOUSE_BUTTON_LEFT:
|
||||
|
|
@ -26,4 +28,5 @@ var swing_start = Vector2(0, 0)
|
|||
|
||||
|
||||
func _on_texture_button_button_down() -> void:
|
||||
audio_player.play()
|
||||
gavel_hit.emit()
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue