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.
Merry Christmas
Merry Christmas to all.
This Christmas eve I find myself doing a report on Domain Name Service (DNS) and the Simple Mail Transfer Protocol (SMTP) thanks in no part to SP’s assignments.
Where is the spirit of Christmas I’m supposed to feel? Burried somewhere under the mountain of books I gotta mug for MST.
Were is the festive mood? Chased away by the tons of homework SP decided to give us.
Not having my Grandma to share Christmas with ain’t making it any better.
In other news, Sec 1 Registration was fun (as if main VS events are ever boring). Went for briefing on thursday, proposed to implement a queue management system for the Registration on Friday.
So ok. Went back home, coded a primitive system to track the queue numbers that would be projected onto the wall next to the stage. Come Registration day, one projector was too weak. So had to recode the app to run from just one side.
Brings back memories of having to recode the Head Prefect Election script. What is it with my code and VS? sigh.
So yeah,
‘Merry’ Christmas to me.
Merry Christmas to all.
localtime() Error
Figured out what was wrong with my date calculation. Take a look at the code below:
$thismonth = (Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Nov,Dec)[(localtime)[4]];
I think even non-programmers would be able to see what’s wrong. I totally missed it.
Ridiculous.
Go Jump Down
ARRGH!! Just finished Java exam today. Missed this ONE important sentence that said we needed to code the algorithm with a while loop.
I used a bloody for loop.
Freaking hell.. Its like 10% of the bloody paper lah (5% of total assessment criteria).. Lets calculate:
First Practical Test : 24(%) / 25(%)
BallGame Assignment: hopefully 23-24(%) / 25(%)
Thats 47% / 50%.. Which means I need to get ALL the damn questions right for this exam (giving me 45(%) / 50(%)) in order to even hope for a distinction.
BASKET. Can go jump down liow.
Java Assignment: BallGame
Ok, as I mentioned in my previous post, the BallGame Java Applet that I coded for my school practical assignment can be found at http://www.jonaize.com/ballGame/. Pls note that you need the latest Java Runtime Environment, downloadable from java.com. Enjoy..
See if you can beat my highscore.. hehe..
I’ll be releasing the source code for the game soon. Gotta clean it up a bit and wanna add some more features first.