Oct 132011
 

I wanted to work on an iPhone/Android port of Arrow Antics; one of my older games. The original game was written using SDL, but the current state of SDL 1.3 is still a bit flaky and not ready to release products with.

I started looking at various 2D iPhone solutions. The two most popular 2D iPhone SDK’s appear to be Corona by Ansca, and Cocos2D.

Cocos2D
Cocos2D has an Objective-C based API. Personally, if I wanted to use Objective-C I would just code directly to the iOS SDK. However, for less experienced programmers there is a lot of value in not having to write the functionality included in the Cocos2D SDK. So, for me, I quickly ruled out Cocos2D.

Corona
Corona SDK is a Lua based solution that supports iOS based apps (iPhone/iPad) and Android based apps (Droid, NexusOne, myTouch, GalaxyTab). Since all of the app logic is written in Lua, it is a “write once, run anywhere” type solution; at least for iOS and Android based systems.

Corona Pros
Obviously the biggest strength of Corona is that it is a cross platform solution. If you are only targeting iOS then you can go with the iOS SDK or Cocos2D. However, if you think that you might want to deploy your app on other platforms then you will want a solution like Corona. There are a lot of nice features that Corona supports, including physics using Box2D, Facebook Connect, OpenFeint support, and most importantly native device features.

Corona Cons
The most obvious drawback to Corona is the lack of a UI Layout tool. If you want to place images, buttons, widgets, etc on the screen you have to do it all in Lua like this:


local helpGroup = display.newGroup()
local backgroundImage = display.newImageRect( "Background.png", 480, 320 )
backgroundImage.x = 240; backgroundImage.y = 160
thisGroup:insert( backgroundImage )

Sure, this is only a few lines of code. However, it means you have to do something like this for EVERY display object in your app. Why not have a layout tool that writes out a layout file in XML or JSON? Then for each screen in your app you could just load the data file and it would create your display objects and add them to the display group.

Conclusion
I will no doubt find other strengths and weaknesses with Corona as I continue the port of Arrow Antics. Look for more info soon.

P.S.: Like this article?! Want to support?! Be free to donate with bitcoins! 19r39vr2zs14aHW6DMNtPjmRga9xERQTTP

 Posted by at 3:15 am

  2 Responses to “iPhone/Android SDK’s”

  1. Thank you for the kind words. You are welcome to grab the feed and stay up to date on my posts; hopefully I will have more time to devote to this blog.

  2. Win/Linux/Mac/Android/iOS 2D engine, entity/component based, fully data driven, supports animated sprites, fonts, parallax scrolling. HTML/CSS GUIs via transparent integration with libRocket. Dynamic development and fully static binary only deployment to targets. Simple building and packaging for all targets using the Schafer tool. Actively developed.

Sorry, the comment form is closed at this time.