Eclipse + Java are not really my style, so I figured I'd try Adobe AIR.
Adobe AIR works out-of-the-box -mostly-.
FlashDevelop works out-of-the-box -moderately-
The meat:Since there are keyboard binding for the game pad it seems the D-PAD, analogue sticks and the O and U buttons are mapped to common keyboard keys. You can access them with a standard stage.addEventListener(KeyboardEvent.KEY_DOWN, callback); call.
I will be writing proper game pad hooks in the days to come, but for now you CAN port your games made in AS3. This would include Flixel, FlashPunk, Stage3D, PaperVision, etc. It also means you can program in HAXE or AS3. I know there are a lot of HAXE fans out there.
The potatoes:For now, I'll provide a real OUYA Adobe Air example and how to work with it.
First download the example for comparison purposes
http://danmckinnon.net/downloads/mobile_air_test.zipThis is mostly a normal Flash Develop Mobile Air 3 template, so I'll walk you through how to make this project on your own.
1. Create the project

2. Edit 'Run.bat' and change
SCREEN_SIZE=10803. Now go to Project->Properties
4. Change the platform to Air 3.1
5. Open application.xml and change the application name space to AIR 3.1 on line 2
<application xmlns="http://ns.adobe.com/air/application/3.1">6. In the folder /bat, run the program CreateCertificate.bat once
7. In the root folder, now run /PackageApp.bat
Choose option 3, captive package. This just includes the AIR Runtime with the program so the OUYA doesn't have to download it seperately.
UBUNTU
8-1. Install android development tools. In Ubuntu, this can be done with the command
sudo apt-get install android-tools-adbWINDOWS
8-2a. In windows you will have to download the Android SDK from here
http://developer.android.com/sdk/index.html8-2b. In Windows set your PATH environment variable to point to the bin directory. To do that I think you go to Control Panel->System->Environment then edit the PATH variable, add a semi-colon followed by c:\android-sdk\bin. This will give you command-line access to ADB so you can install software onto your OUYA from your PC. It should look something like this
PATH=c:\windows\system;c:\windows;c:\windows\system32;c:\android-sdk\bin9. In a console window, change directory to /dist
10. Assuming you have only the OUYA connected and no Virtual Devices or other androids type...
adb install -r MobileAirTest-captive-runtime.apk11. On the OUYA go to Devs->Software
12. Your project should appear as an Adobe AIR icon.
13. Viola! Run it and enjoy a breath of fresh AIR.
Note:For the bulk of your work, test on the PC and deploy on the OUYA sparingly. It's a bit of a bulky way to do the bulk of your testing andthis way you won't get any debugging features when running on the OUYA.
I'm sure there is a way, so once I figure out a quicker way to run a debugging environment on the OUYA I will post instructions.
Suese
Comments
O = 13 KEY_ENTER
Left = 37 KEY_LEFT
Up = 38 KEY_UP
Right = 39 KEY_RIGHT
Down = 40 KEY_DOWN
The other buttons don't work, and the A key even exits the program. A little bit buggy but it's a tremendous start.
Likewise, the "U" button is assigned by default to the Android MENU key (I don't have a dev kit, I'm just going by the docs).
The only face button that doesn't have a default Android key binding is the "Y" button.
If someone is familiar with Native Extensions for Android, I'm curious about using STDOUT to communicate events..
I worry that using STDOUT to communicate to the AIR application might have some latency, which is no good if it's going to have to make a lot of constant calls to the ODK anywhere.
I built a simple app that would record key strokes and then trace out the keyCode. Here is what I got:
up 38
down 40
left 37
right 39
left click 13
right click 13
O 13
U 16777234
A 16777238
I believe Y might be linked to android menu. I had to do e.preventDefault() to get A from backing out of the app. Clicking in both sticks or pressing O will give you keycode 13 (ENTER). None of the 4 trigger buttons returned any codes.
The directional codes are thrown for the left control stick and D-Pad only. Right stick only gives me ENTER (13) on click -- no directional.
CEO, Rocket Bunny Games
So... bummer.. Stage3D isn't working either.
FlashDevelop caveat discovered
I went into the Project->AIR App Properties->Initial Window->Non Window Platform->Render Mode->GPU
I thought the compiler flag -use-gpu=true would work, but apparently it did not. My game runs like a CHARM.
w0000000000000t
CEO, Rocket Bunny Games
As this guy mentions: http://chrischurn.co.uk/blog/flashdevelop-stage3d-and-mobile-air3-2/
Just download a fresh version of Air SDK 3.5 and copy it directly into your flex-sdk folder. Stage3D enabled and running oh-so-smooth!
http://www.adobe.com/devnet/air/air-sdk-download.html
www.yummycircus.com
I'm looking into using Away3D 4.1, AwayPhysics, Stage3D, and AIR for developing OUYA games, but I'd love to know if I can get REAL access to the gamepad (all buttons, direct access to stick values, triggers, etc), and I'd also like to be able to trigger IAP calls of course.