Interview with Josh Lytle, Game Director for Wolf Toss. Moai interview: Hi Josh. Why don’t you start by telling us how long you’ve been working with Lua?

Josh: Well, it’s been a while. I think I first started working with Lua in 2003 at Amaze Entertainment.

Moai interview: Cool. How’s the game coming along?

Josh: It’s coming along well. The very first Wolf Toss demo was done really fast – in just 5 days, so as you can imagine, we cut a few corners in terms of making it easy to extend. For the last week, I’ve been restructuring things and working on the tool chain so we can make progress really fast in the next month.

Moai interview: It looks like you’ve been pulling more and more art assets into the game from Flash.

Josh: That’s right. Lots of artists use it, so it’s a good thing that Moai works with it.

Moai interview: What are you using to get the Flash assets into the game?

Josh: There are 3 scripts for getting Flash assets and animations into Moai games now. They create tightly packed, maximum-size texture out of all the symbols in your Flash library that in turn make up all your frames.

Moai interview: Does that save a lot of time?

Josh: A huge amount of time. The script produces a PNG file and a Lua file that defines all of the frames as combinations of the textures referenced by UV coordinates. With this data, you can create sprites just by specifying which frame to use (the same frames that you were looking at in Flash). As a game programmer, you can waste a huge amount of time doing hands-on texture management, texture packing and UV coordinate translations, so this is a big time saver.

Moai interview: Sounds great. Can you show us the output?

Josh: Absolutely [shows the following texture]...

[caption id="attachment_792" align="aligncenter" width="515" caption="One Wolf Toss texture, tightly packed with art."]<a rel="attachment wp-att-792" href="">A texture made up of lots of independent images used for characters and objects in Wolf Toss.[/caption]

Moai interview: What are the other scripts for?

Josh: The next two scripts are for pulling flash animations into Moai as anims. One works with frame animations from your Flash timeline. The other one works for Tween anims based on keyframes. So pretty much all the common ways people create animation and art assets in Flash be easily pulled into Moai games.

Moai interview: Cool. And how do you run those animations in game.

Josh: It's pretty easy, here's the Lua file [shows this code]. It calls functions I wrote named "loadFlashFlipbookAnim" and "loadFlashTweenAnim" to do the importing work. The code for loadFlashFlibookAnim is based on the Flash importer sample code provided in the Moai SDK.

[caption id="attachment_793" align="aligncenter" width="690" caption="Including Flash Animations in Moai Games"]<a rel="attachment wp-att-793" href="">10 lines of Lua code for creating sprites shown in a code editor[/caption]

Moai interview: Nice. I notice Dalton’s been creating a lot of new art lately. So the big question is, when will Wolf Toss be ready for the next round of playtesting?

Josh: Come back on Friday and I’ll be ready to demo the new work.