Yes another tiny project – experimenting with playing audio; which I expected to be much harder than it turned out to be. In fact, you can just embed an
audio element and call its
This project also makes an attempt at using the accelerometer, using a bit of code from Dan Cox to provide cross browser support.
I actually wrote this under a slightly different name for some former colleagues of mine; and I wanted to email it to them – so another interesting technique I used was to embed the image and audio data directly into the HTML; so I can “ship it” as one file.
Anyway – if I can just stop procrastinating maybe I can finish off a few more important jobs…
I’ve added a new little project – Isometric. It’s breaking the rules a little bit because it’s not a fully completed project; but I think better to publish than not. I guess eventually it could be a whack-a-mole type game.
It’s not driven in the most efficient way – I’ve written a little geometry library and use matrices to transform and scale coordinates to match what I need to draw out my little isometric tiles. But it’s a fun way to do it and gives me an easy way to reverse a screen-coordinate mouse click to get a world-coordinate tile; which is otherwise quite challenging with an isometric viewpoint.
The code is, as usual; disgusting at the moment, including some commented out stuff for rendering world tiles like grass and sea; and some “inline tests” which check the code is giving the expected result and pops up alert boxes when it fails! Shocking!
I’ll investigate a JS unit testing framework and integrate it into my workflow next time; it’d be a massive help for this kind of trivially testable stuff.