adjusted key sound
This commit is contained in:
parent
a07d929c4c
commit
8088322761
1 changed files with 3 additions and 3 deletions
|
@ -2,10 +2,10 @@ extends Node2D
|
||||||
|
|
||||||
const SEMITONE := 1.05946
|
const SEMITONE := 1.05946
|
||||||
const TIMEOUT := 1000
|
const TIMEOUT := 1000
|
||||||
const MAX_PITCH := 5.0
|
const MAX_PITCH := 2.0
|
||||||
|
|
||||||
const STATIC = {
|
const STATIC = {
|
||||||
pitch = -2.0,
|
pitch = -1.0,
|
||||||
timeout = -1,
|
timeout = -1,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -24,7 +24,7 @@ func _on_Area2D_body_entered(body: Node) -> void:
|
||||||
if Time.get_ticks_msec() < STATIC.timeout:
|
if Time.get_ticks_msec() < STATIC.timeout:
|
||||||
STATIC.pitch = min(STATIC.pitch + 1.0, MAX_PITCH)
|
STATIC.pitch = min(STATIC.pitch + 1.0, MAX_PITCH)
|
||||||
else:
|
else:
|
||||||
STATIC.pitch = -2.0
|
STATIC.pitch = -1.0
|
||||||
STATIC.timeout = Time.get_ticks_msec() + TIMEOUT
|
STATIC.timeout = Time.get_ticks_msec() + TIMEOUT
|
||||||
Audio.play_sound(Audio.a_key,Audio.ac_collectible, pow(SEMITONE, STATIC.pitch))
|
Audio.play_sound(Audio.a_key,Audio.ac_collectible, pow(SEMITONE, STATIC.pitch))
|
||||||
queue_free()
|
queue_free()
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue