Johan Peitz - Let's make SOMETHING


Flash on iOS Devices

Any game developer who hasn't been hiding under a rock the for the last few weeks or so should know that with the latest Air SDK and Flash Builder you can now package your flash games for iOS, Android and Playbook. It has been possible for some time, but it is a lot more streamlined now and with Air 2.7 it is also a lot faster once it's on the phone. It took a while to figure out how apple wants the keys, certificates and whatnots configured when working on Windows, but thanks to google, other blogs and the adobe forum, it eventually worked.

Getting the display list to work as I wanted  with the GPU was a bit of a hassle but now I have a pretty nice pipeline. I can do pretty much anything I want (within reasonable limits) on the iPhone at 30 fps and on the iPad 2 I gat 60 fps. So, lots of performance!

First I wanted to test hop many sprites I could have on screen at the same time so I dusted of my old shooter 194x and ported parts of it. It works really smooth using touch to move the plane to the desired position. And autofire is constantly on. :)


Second prototype uses tilemaps and platform physics and for this I used an even older concept only known as "Hodja". I guess the idea behind Hodja is at least 6-7 years old but I never got around implementing it for real. Hodja as some nice history that I might tell in another post. :) Anyway, again really good performance.

For both 194x and Hodja I wanted upscaled pixel graphics.  Scaling bitmaps on the GPU on iOS devices adds a blur which looks like crap when applied to pixelated graphics. I tried and tested many solutions to this but none worked. The current version of the engine scales the graphics up when it is loaded and then moves around it in set increments of pixels, thereby circumventing the blurring completely. There seems to be a small performance cost to this as to traditional blitting, but it is very small.

I hope to finish the Hodja game over the summer. It has a really nice vibe to it.

And some credits: The pixel art for the shooter was created by Arvid Wessman who also helped some with the pixel art for the platformer.