VBAS Assignment
Please excuse me while I rant and bitch about my Visual Basic Assignment.
– Begin ranting
So I decided to have sounds that overlap each over for my game (one sound playing background music and other sounds to provide sound effects). So fine, tried to use my existing framework to accomplish that.
My existing framework being a class that interfaces with the Windows API (winmm.dll) to send a sound stream to the soundcard. The textbook solution was to embed a Windows Media Player control into the form and call it to play the sounds I required. This solution was not very elegant as I had trouble getting the sound to loop (for the background sound) and when I did, it was not smooth at all.
That was some time back, when I first started coding the game. Now that I’m 95% done, I had to revisit to add overlapping funtionality to my class. After 2+ hours of trying every trick I could think of, I discovered that the interface with the Windows API does not allow me to have 2 sounds playing simultaniously.
Bloody Hell. Nevermind, took a break.
Then I had a brillent idea. I decided to use Threads to each execute an instance of the class. So I spent another 1+ hour on it. Then tested. Damn. Still doesn’t work.
At the end of it all, I went back to using the textbook Windows Media Player solution. It works. So now I have my API interfacing class running the background music AND the Media Player. Not forgetting 3+ hours of wasted productivity.
Why wasted productivity?? Because I learnt things that is not covered in my VBAS syllabus. Wait? Isn’t that a good thing? Learning beyond the textbook?
Not when you’re in an education system as screwed up as Singapore’s one is.
– End Ranting
Righto, now that that is off my chest, the PHP cBoard is now functioning. Beta testers anyone? The account management, however, is taking longer then I expected. Hopefully I’ll find time here and there to put things together. Anyhow, the PHP cBoard is running on my blog, so if you encounter any errors tagging or whatnots, please do let me know.