2012.11.21Haxe giving Air to Starling
I almost forgot to talk about Bloblocks' underpants :)
Bloblocks:
- is programmed using the Haxe programming language,
- uses the Starling Framework (remember this post?),
- embeds some assets with NME to produce an SWF,
- is packaged for iOS and Android using AIR SDK
Bloblocks also:
- uses SickSports's GameCenter ANE to support iOS Game Center
- uses Lancelotmobile.com's ANE to handle AdMob on Android (Bloblocks lite)
- used Gree's ANE to communicate with the Gree platform an Android but I don't like this platform and decided to remove it and wait for Google to create some GameCenter equivalent
Except for the ANE part (which stinks) the development was a breeze, SWF is solid, looks the same everywhere, just work.
Starling's API is really easy to get and the stage3d GPU acceleration do a lot. Even if the game is simple I am pretty happy with its FPS. Plus the acceleration works on the web too.
I was a real novice in the mobile field and this project was a great experiment for me. Here are a few things I learned the hard way, may be useful to someone someday, may be not :)
On resources:
- use bitmap fonts,
- use sprite sheets (really),
- don't make your sheets too big,
- use Apple Instruments to check memory usage
On screen size:
- phones have really small screens,
- think dpi not pixels,
- poor man simulator is great,
- don't hesitate to create different controls for different sizes,
- layout for a resolution then scale and center is an easy solution :)
On feedback:
On ANE:
- they stink but they usually work
-
learn how to create SWC from project sources, sometimes it is as easy as running ant, sometimes you have to fight and
acompc -source-path src -output Gree.swc -swf-version 17 -external-library-path+=/Users/lbedubourg/local/lib/flex/frameworks/libs/air/airglobal.swc -compiler.define BUILD_CONFIG::stub false -include-classes
find src -name "*.as" | sed "s/src\\///" | sed "s/\\.as\\$$//" | sed "s/\\//./g"
- unzip the SWC to get the library.swf and use that as a -swf-lib for Haxe
- concerning the .ane file… well read adobe doc, I don't have the time to explain there :)
On Air SDK:
- it works out of the box, but the documentation is bloated,
- the iOS packaging is really slow, for quick tests not requiring iOS, using an android device is faster,
On Starling-Framework:
- peace of cake
- excellent community and doc
- use sprite sheets!