adjusted key sound

This commit is contained in:
pennyrigate 2023-12-26 21:52:13 -05:00
parent a07d929c4c
commit 8088322761

View file

@ -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()