Here is a screenshot:
My initial game was ok but had a few bugs in it. I have since cleaned it up and added scoring. I even added an end game model. One snag that I really am stuck on has to do with sound. Firstly I found out how easy it was to add sound using html5 audio tags… I thought it would be alot harder but apparently not. I added an <audio> tag to my page, and in the js just loaded it and played. about 5 lines of code in all… however I have hit a few snags and I am not sure why.
Firstly, I couldn’t get the audio to load in Webkit… I thought at first that it was because the format (ogg) was unsupported so I put in a bit of code to load an mp3 instead but that didn’t work either. I’m going to have to probably play around with a simpler demo first. I’m trying to find out if it needs to be enabled right now (like webGL) but so far have not found anything about having to enable it.
The other problem I ran into which I really really don’t understand is that on minefield, when I ran my game locally, it had no problem loading the audio file. It played and didn’t have any trouble. But when I uploaded my files to make them available to the web the sound broke… this makes no sense to me as to why this would be the case. So far I have checked these issues:
- relative path is correct (actually no path…the file is in same folder as html)
- the permissions are correct
- the transfer seems fine
- files are in the directory
I really don’t understand why it should not work from my site while it worked locally. I have checked it out with firebug and it seems the audio object is created so I’m not quite sure where to check next. In any case perhaps I’ll take a page from my old school days and sleep on my bug…