// then scramble
var r1, r2;
for( i = 0; i < numpieces>>1; i++ )
{
exchange( Math.random() * numpieces >> 0, Math.random() * numpieces >> 0 );
}
Easily enough fixed by just "manually" sliding a random piece adjacent to the hole a couple thousand or so times, but yeah... Making any sort of game, no matter how simple, is harder than you think :\
I agree, the extensive gallery really made an impression and give far more weight to the library. It should serve as inspiration for other library creators to really put time into a wide set of demos of what your lib can help achieve.
Excellent presentation of the library. After reading the source, I am struck with how much of the code here is just one or two line wrappers; "convenience" functions that don't really do anything but pass on the arguments to another function or set or get a property.
I'm not a big fan of thin API wrappers like this. Why not dispense will all that code and let your library users access the underlying properties and methods instead? The library would be smaller, simpler, and faster.
Please consider this library as an invitation for web devs to dive into html-based multimedia. Its main goal is to highlight the ability to do such things.
It is quite clear that Sprite3D will never reach the level of libraries like Three.js or PaperJS.
My company just launched a new mobile panorama viewer based on similar ideas, though we did our own super-minimal sprite3D to support our needs.
The really fun thing is that you can wire up the iPhone 4 and iPad 2 gyroscope to it to control the camera, makes for quite a demo :)
http://www.tourbuzz.net/29288?awesome