extends Node var tracks: Dictionary = {} var voice := AudioStreamPlayer.new() var gates: Dictionary = {} func _ready() -> void: for name in ["human-die","startup","electrode-explode","level-transition","spheroid-spawn","enforcer-fire","player-lazer","grunt-walk","human-save","robot-explode","player-death","game-start","tank-explode","tank-projectile-bounce","tank-fire","quark-spawn","brain-explode","prog-transformation","human-to-prog","extra-life","high-score-top","brain-wave-start","spheroid-pop"]: tracks[name] = load("res://games/robotron/audio/"+name+".wav") voice.volume_db = -15 add_child(voice) func effect(name: String) -> void: if get_parent().demo or not get_parent().sound_enabled or not tracks.has(name): return var now := Time.get_ticks_msec() if now void: voice.stop() gates.clear()