forked from team-sg/hero-mark-2
button sound!
This commit is contained in:
parent
00558c3e13
commit
b548612ecc
4 changed files with 19 additions and 0 deletions
BIN
audio/sounds/button.ogg
Normal file
BIN
audio/sounds/button.ogg
Normal file
Binary file not shown.
15
audio/sounds/button.ogg.import
Normal file
15
audio/sounds/button.ogg.import
Normal file
|
@ -0,0 +1,15 @@
|
||||||
|
[remap]
|
||||||
|
|
||||||
|
importer="ogg_vorbis"
|
||||||
|
type="AudioStreamOGGVorbis"
|
||||||
|
path="res://.import/button.ogg-c5f23a6f7088dd5f53927529b8710876.oggstr"
|
||||||
|
|
||||||
|
[deps]
|
||||||
|
|
||||||
|
source_file="res://audio/sounds/button.ogg"
|
||||||
|
dest_files=[ "res://.import/button.ogg-c5f23a6f7088dd5f53927529b8710876.oggstr" ]
|
||||||
|
|
||||||
|
[params]
|
||||||
|
|
||||||
|
loop=false
|
||||||
|
loop_offset=0
|
|
@ -1,6 +1,7 @@
|
||||||
extends "res://objects/environment/switches/switch.gd"
|
extends "res://objects/environment/switches/switch.gd"
|
||||||
|
|
||||||
var pressed = false
|
var pressed = false
|
||||||
|
var sound = load("res://audio/sounds/button.ogg")
|
||||||
|
|
||||||
func _on_ActivationArea_area_entered(area):
|
func _on_ActivationArea_area_entered(area):
|
||||||
if !pressed:
|
if !pressed:
|
||||||
|
@ -8,3 +9,4 @@ func _on_ActivationArea_area_entered(area):
|
||||||
activate()
|
activate()
|
||||||
$Sprite.frame = 1
|
$Sprite.frame = 1
|
||||||
pressed = true
|
pressed = true
|
||||||
|
Audio.play_sound(sound,$AudioStreamPlayer)
|
||||||
|
|
|
@ -26,4 +26,6 @@ polygon = PoolVector2Array( 1, 7, 0, 8, 1, 8, 7, 8, 8, 8, 7, 7 )
|
||||||
position = Vector2( 4, 6.5 )
|
position = Vector2( 4, 6.5 )
|
||||||
shape = SubResource( 1 )
|
shape = SubResource( 1 )
|
||||||
|
|
||||||
|
[node name="AudioStreamPlayer" type="AudioStreamPlayer" parent="."]
|
||||||
|
|
||||||
[connection signal="area_entered" from="ActivationArea" to="." method="_on_ActivationArea_area_entered"]
|
[connection signal="area_entered" from="ActivationArea" to="." method="_on_ActivationArea_area_entered"]
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue