development     reviews     feed

Does it sound like it's raining?

Yep! I just got done adding a new class to allow game objects to play audio, using the helpful information here. I’m using XACT to manage all of my audio files, so I created an initial Wave Bank and Sound Bank and instantiate those with the AudioEngine class, and then just take requests from other objects when they want sounds to be played. For now, I’ve allowed my map files to have a “BackgroundTrack” property defining the name of a background track to play for the map, and it’s the sound of rain to go along with the rain particle effect that I’m using in the current demo.

So it’s great that all that’s figured out. The next thing I need to do soundwise is figure out how to have so-called “3D Sound,” but in my 2D environment, so that as the player gets closer to certain sound-making objects the audio for them gets louder. I realize now that the “dynamic audio” I had in mind is not exactly difficult, because I can just play sound whenever I want with any object; all they need to do is request the correct sound be played at the correct time. I’ll probably move on to other functionality for now, because at the moment I just wanted to make sure that I could create a basic Audio class and be able to play sounds or background tracks with it.

The real next step is going to be integrating a configuration library I found called EasyConfig, which will let me define configuration files easily and intuitively. After that’s done, I’m going to move on to either creating a MovingPlatformComponent that moves between a list of points at a given speed, or creating a simple way for me to script basic cutscenes so that I can create the opening sequence for Ne+.