meat_madness_redux/godot/assets/meat_creek/WhaleSounds.gd

22 lines
400 B
GDScript3
Raw Normal View History

2022-12-27 20:06:15 -07:00
extends AudioStreamPlayer
export var min_wait: float
export var max_wait: float
func start_timer():
var wait = rand_range(min_wait, max_wait)
$Timer.start(wait)
func _on_Timer_timeout():
play()
func _on_sound_finished():
start_timer()
var needs_bootstrap = true
func _process(_delta):
if needs_bootstrap and Util.player.camera_position().y < -18:
needs_bootstrap = false
start_timer()