I am doing this in script. All my objects (except the player) are simple "box without collision" at the moment.
I am experimenting with scripted movement of objects. Rotation, re-positioning etc.
There will be a tutorial of this added to the
"Create Tutorials For Inclusion In The Game Core Tutorials Menu"
http://www2.gamecore.ca/forums/index.php?topic=34.0It will be a simple "run the gauntlet" game. Basically a corridor with swinging blades and stabbing spears and a player to navigate safely through it.
All working now, just got to work on the collisions.(thats going to challenge me I think, I have no idea at the moment)
Actually, not long after I posted the question I thought, "Why not check the BV documentation" and there it all was.
So here is what I did (for anyone else who may read this with a similar problem)
In the gsl file for the scripted object
1) At the top of the file create a global variable of type sample. (Global for all fuctions within this particular script file, that is)
Sample MySound;
2) In the Initialise function load and setup the sound
Pos=object.GetPosition(); //Get the position of the object so the sound can be set to the same place
MySound.Load("woosh.wav"); //I have the sound file in the same location as the object and gsl files
MySound.SetVolume(1);
MySound.SetPosition(Pos);
MySound.SetMinDistance(1);
3) Now in the function where movement occurs play the sound. I have it in the DynamicsAdvance function
MySound.Play();
The only problem I have now is that I have 3 objects all using this 1 script.
This must mean I am loading the same sound file 3 times.
Where should I move the loading of the sound so that it is loaded only once?