Sound.gd 247 B

123456789101112131415161718
  1. extends AudioStreamPlayer2D
  2. const PITCH_MIN = 0.8
  3. const PITCH_MAX = 2.6
  4. func _on_repeater_timeout():
  5. trigger()
  6. func trigger():
  7. set_pitch_scale(randf_range(PITCH_MIN, PITCH_MAX))
  8. play(0.0)
  9. func _on_trigger_area_entered(area):
  10. trigger()