Has anyone gotten a FlashPunk game running on the OUYA?


(David Williams) #21

In your init function, try adding:

addEventListener(Event.ACTIVATE, this.onActivate);
addEventListener(Event.DEACTIVATE, this.onDeactivate);

Then you can try pasuing/playing the music in the onActivate and onDeactivate functions.


(Andrew) #22

Thanks! After researching your advice, I ended up with this:

this.stage.addEventListener(flash.events.Event.ACTIVATE, onResume, false, 0, true); this.stage.addEventListener(flash.events.Event.DEACTIVATE, onPause, false, 0, true);

in my init, and then:

private function onPause(event:flash.events.Event):void
{
  SoundMixer.stopAll();
}

private function onResume(event:flash.events.Event):void
{
  FP.world = new MenuWorld();
}

Which suits me perfectly! Normally you would save the game state in pause and then resume it in resume, but my game doesn’t really need that (you’ll want to start again on resuming), so this simpler approach suits me fine.

And with that, I’m ready to launch the game. Thanks to everyone who helped in this thread! It was quite a bit of fun working it all out.


(Andrew) #23

My games THOSE DARN NIPPLES and GROIN GRAVITATORS are now on OUYA!

Here are a few extra tips for getting a game on OUYA.

  • You’ll need a 732x412 icon. Just dump it in the icons/android folder and add an extra line to the application.xml specifying the new icon size and location.

  • In the application.xml, there will be a manifest additions section. In it, you’ll need to add:

  • Finally, when you submit the game to OUYA, make sure you specify that the .apk file has “air.” in front of it. For example:

air.MyGame

Trust me, it will save you a lot of trouble.