The sound_pool has a method for the river example, but it takes several arguments, and it can be hard to remember all of them and what order they're in.
pool.play_extended_2d("river.wav", listener_x, listener_y, sound_x, sound_y, left_range, right_range, backward_range, forward_range, looping, offset, start_pan, start_volume, start_pitch);
In this case, I'd make looping = true, and ofset and start_ values 0.0, except for start_pitch, because a pitch of 0 is almost inaudible. If you don't want any special pitch, just use 100.
I find play_extended methods to be somewhat cumbersome, so I write a function to save time. However, this works because I usually keep track of the camera separately, and use geometric objects to keep all the position and range values manageable.
Basically, the sound_pool is a fire-and-forget method of playing sounds. It allows you to easily update the entire soundscape when the player moves, but optionally keep variables for the sound slots, if you need to move them individually. You can also set all of your step and behind variables once (or just use the defaults), and never type them again. You can easily pause_all, resume_all, and destroy_all.
You might call it a soundscape manager.
看過來!
"If you want utopia but reality gives you Lovecraft, you don't give up, you carve your utopia out of the corpses of dead gods."
MaxAngor wrote:
George... Don't do that.