Stop thrust audio on crash / success

Just as an FYI… this introduces a minor bug to the game and it’s a quick fix.

You will probably want to stop the audio when you crash and when you complete the level successfully. In certain instances, you can hit the ground / obstacle or clear the level while pressing the boost key. Should this happen, the sound will continue to play until the sceen reloads or a new level loads.

It is simple to do fix. In the crash and success functions, simply add the “rocket_audio.stop()” before the explosion / success audio.

I added a check to see if it is playing first. I don’t know if it is necessary

func _on_body_entered(body: Node) -> void:
	if is_processing():
		if rocket_audio.playing:
			rocket_audio.stop()
		if "Goal" in body.get_groups():
			complete_level(body.file_path)
		if "Hazard" in body.get_groups():
			crash_sequence()
3 Likes

Privacy & Terms