🎉 Celebrating 25 Years of GameDev.net! 🎉

Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!

Sound progress.

Published May 17, 2007
Advertisement
I worked a bit on the sound code tonight and earlier in the week. Added a bunch of sound classes which erm... make no sound. Included:

Silence - Takes a TimeSpan, and behaves like a sound object of that length with no actual sound.
Sequence - Takes two sound objects and ensures that they play one after another. Any methods are directed to the one actually playing.
SynchronizedPair - Takes two sound objects and plays them together (waiting until both finish to trigger the 'done' event). Methods effect both.
Fader - Decorator to fade the volume.
Looper - Decorator to loop the sound.

These should allow me to 'build' some sound effects via the composite pattern, like *whizz* *-wait wait-* *BANG* out of their parts rather than busting out my non-existent sound editor.


I also added a long overdue addition to my resource manager. Currently you say Load("definition"). The definition is linked to a longer string which is interpreted, stuff loaded, and returned. Useful since 'TitleMusic' can have its actual load commands changed without editing the load requests everywhere.

Unfortunately, it's a pain to just run commands through the interpreter that way. Direct interpretation is useful for these sort of decorators when their creation parameters is another load string. So I added a breakout to the interpreter. Load("!CommandString") now calls LoadAnon("CommandString") passing the string as a command through to the interpreter directly and returning the result.

I am glad my interpreter setup is flexible and powerful enough to deal with such things. I am disheartened that I'm using a powerful and flexible interpreter to just load stuff. I'm further disheartened that I'm using one I wrote rather than a myriad of pre-made alternatives...

Ah well. It works, and now more stuff works. Make stuff work first; retrospect decisions after.
Previous Entry Meh!
Next Entry Not much of note.
0 likes 0 comments

Comments

Nobody has left a comment. You can be the first!
You must log in to join the conversation.
Don't have a GameDev.net account? Sign up!
Profile
Author
Advertisement
Advertisement