OUYA Game Jam: The Start

18 January 2013

I’ve always been a gaming fan and kept an eye on the games industry, but the one and only game I’ve written was a silly two player pong game for a just-for-fun class senior year of college (taught by the excellent Joe McKay). So, when my friend Lily asked if I wanted to apply my Android experience to coding a game for the OUYA/Kill Screen CREATE Game Jam, I decided to take a chance on learning a bit more about this whole game programming thing.

Lily already had a vague gameplay idea, working title Noah’s Art, where the player would switch color filters which would effect how they could interact with differently colored objects in a top-down world. Her friend Josh joined in to help with gameplay design. I started by researching different game engines for Android. Of the simple open source Android libraries, LibGDX seemed the best maintained, had the most community support, and good 2d support. Then there’s Unity, a very popular commercial library that supports every platform under the sun, is a sponsor of the jam, and looks like it does a lot of work for you if you can figure out how to use it. In the end the deciding factor wound up being the wifi at the coffee shop I was working at on Monday: the 1GB+ Unity download kept getting cut off. I was also concerned about the hefty price tag on Unity, while LibGDX let me avoid those concerns.

The first task was getting a cursor to display on screen, as the player will manipulate wandering animals with a cursor controlled with one of the OUYA controller thumbsticks. I added support for the OUYA controller using LibGDX’s new controller support (I also added mouse controls for LibGDX’s desktop mode for development testing). It turns out getting controller state in LibGDX is pretty easy: on every game loop just check where the stick is and set the cursor’s velocity accordingly, then update its location based on that velocity. The stick axis value is a fraction between -1 and 1 to denote all the way down or all the way up: