Over a month ago now, I posted about a proof-of-concept video of Twine running on the Ouya using CocoonJS. At the time, I was cautiously optimistic about getting Twine projects on the Ouya. It seemed as if it was just a matter of figuring out a few things.
Two of those were getting gamepad input and IAP working. Gamepad input, as I’ve come to find out, only works with CocoonJS’ accelerated mode. It is the mode that has a reduced DOM, no CSS model, and is missing XML support. It makes Canvas-based projects run faster as a result, but can often be a stumbling block to common website design practices.
The other real problem was in-app purchases (IAP). Previous to a blog post two days ago announcing that demos, which use IAP, are not longer a requirement on the Ouya, it seemed as if CocoonJS wasn’t going to be a viable platform for anything Ouya related. IAP, you see, depends on a cryptographic exchange. Unlike Google Play and Amazon, which handle authentication on their end, Ouya had developers doing authentication in-memory and then making a request.
Since posting that video and learning about those issues, I haven’t really worked too hard on getting Twine on the Ouya. I had turned to working several HTML5 libraries and submitting patches for various things. However, after a recent quick conversations with Anna Anthropy on Twitter yesterday, I thought I would look into it again and see if I could come up with a way to load a Twine file and use a gamepad as input.
The following video is what I came up with after a few hours of tinkering with some code.
My “index.html” file looks like the following. It loads the necessary CocoonJS extensions and my own gamepad code.
It’s far from ideal, but I was excited about how quickly I was able to put something together. And with the IAP gone, it looks like I’m going to try to sell some projects on Ouya as soon as that requirement is lifted too.