I'm working on a horror game and I'm thinking, it's not very scary without good sound effects, right? So, I'm wondring if I can do the following in MMF:
- Changing sound volume according to distance
- EAX
- 3D sound (whether with 2 or 4 speakers)
Changing sound volume according to distance should be easy if you make an expression that calculates the distance:
For example: *inhale*
Root(((Root(X of player - X of ghost)²)²)+((Root(Y of player - Y of ghost)²)²))
I think you need the Advanced Math object to calculate the root.
Err... At least I hope not because that object already has a 'calculate distance' function
You can't change the volume of sound effects though unless you use DMC2 or something to play the sound, or have different sound effects at different volumes for varying degrees of distance. As far as I know, EAX and 3D Sound isn't possible.
Theoretically, with a combination of fastloop and DMC you could achieve this. "Sound objects" could shoot out little detectors that move at insane speeds and bounce off walls using trig... then, when they intercect a detector object (like a sphere) that's around the player, they'd create the sound effect again, but at a lower volume. Basically, you'd have to have the volume that the sound effect is played at based on an alterable value in the "sound particle/detector" that starts off at the base volume and then gradually drops to zero, where the object is destroyed. It'd take a crap-load of code and work, but I think it's achieveable.
I think what X_Sheep is trying to say is to use that Pythagoras theorem thing (however you spell it). I'm sure someone your age would know it by now. As I've learned from school, it's better to tell people how to do things than to give them the exact formula.
And I think MMF comes with an in-built root calculation thing.
Disclaimer: Any sarcasm in my posts will not be mentioned as that would ruin the purpose. It is assumed that the reader is intelligent enough to tell the difference between what is sarcasm and what is not.