Skip to content

Instantly share code, notes, and snippets.

View ethanclevenger91's full-sized avatar

Ethan Clevenger ethanclevenger91

View GitHub Profile
@ethanclevenger91
ethanclevenger91 / gist:8746991
Created February 1, 2014 02:09
Dirty gist for getting Ouya input
OuyaController c = OuyaController.getControllerByPlayer(i);
if(c != null) {
if(c.getButton(OuyaController.BUTTON_A)) {
//Do whatever it is you need to do.
//This can be repeated for each button on the controller
}
float axisY = c.getAxisValue(OuyaController.AXIS_LS_Y);
if(axisY > OuyaController.STICK_DEADZONE) {
switch(i) { //'i' being the player number if you're looping through the number of players
case 0: