• Advertisement
Sign in to follow this  
  • entries
    208
  • comments
    383
  • views
    65752

Code clean-up day...

Sign in to follow this  

256 views

Today was used mostly for cleaning up my code, and fixing some small bugs. Some of the biggest bugs was that everytime you played an mp3 you would only be able to play it once, because for some reason after you played it, it deleted itself from the AudioCache... it was very strange... But the reason that it was happening was that the FileStream that it was using was being closed when the mp3 was finished playing. So in turn I now have to reopen the filestream every time I want to play one of the mp3s. The solution to this is to write my own Mp3Player object which actually goes throught he decoding process. I finally did this with Wavs and Midis so that you can have more control, but the Jlayer API is a mess to figure out how to use.

Another bug was in the CommandProcessor. For some reason it when you chose Log->add it would replace the command box with a different add function, one for the AudioCache. It was very strange. But with a rewrite of that function I got it working again how it was supposed to.

I found a rather big structure error in the TileTracker class, it doesn't effect gameplay, but it does cause some confusion. Right now in the game 'North' is to the upper right hand corner. You would expect that to also be the tile map Y direction right? Oops... it was the X direction, so every time you call a tile location the north and Y axis don't match up. It will take a bunch of digging around in that class to get it working properly (it's spread between three classes).

On a lighter note, you can now run custom scripts from a state at state.init(). This allows for gameplay programming to start. Depending on my homework load this week there might or might not be another cool demo coming up which shows some of the scripting capabilities.

Anyway, I'm off to do some homework...
Sign in to follow this  


1 Comment


Recommended Comments

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Advertisement