Alpha! And the work continues

The past week I have, amongst others worked on a sound manager that will play sounds like footsteps, short sounds that might play a lot during the course of a game session since good sound is almost as important as good visuals for making a truly good game(not that making a truly good game is our current goal, we only want to do as good a game as possible given our limited experience). For this code I used the code of my team-mate as a reference(in this case his sprite manager code, they’re surprisingly similar in their function) because I found out that they used similar methods for setting up(so not to simplify the integration process this time, but still because it would be simpler).

soundmanagerclasssoundmanagerclass2sounmanagerheader

Some images of the code. Unfortunately it doesn’t quite work yet(it only plays one sound at a time) so it will have changed before the week is over most likely.

The code starts out by creating a new sound(don’t think that it’s needed, as a matter of fact I plan on removing it, it’s just there because I was testing methods to make it work) and then an initializing method that specifies what folder it’s supposed to look in(saves a lot of writing). After that it has a function for loading sound files which load them into a map and gives them a name(should do that to the sound too I think, that is what my team-mate does with his sprites in his sprite manager) and if it can’t load from the file it gives an error. Then it has a method for playing the music by setting the sound to the relevant buffer(this is probably where it fails) and then playing it.

This code could probably have been written better if I had spent more time trying to find a useful solution(instead of deciding to write the class for bullets, although I suppose it’s better to do something instead of sitting doing nothing, or not, depends on the person I suppose, it might be argued that having two things not fully finished is bad as well). Other than that I have been pretty bad on the sleeping times so I haven’t really spent the time necessary for this week(I really need to get to thinking about it as a job instead of as a school project and try to spend closer to 8 hours on it everyday).