March 23, 2012

Corona SDK

Well, it’s been a long time since I posted on this blog. Recently, I have been exploring the Corona SDK.  So what is Corona you might ask?  It’s a mobile development tool that allows publishing across multiple platforms, such as iOS, Nook, Kindle, and Android devices. If you are a programmer familiar with ActionScript 1 and/or ActionScript 2, this is the toolkit for you!  Corona SDK uses the .Lua language.  Lua is used for game development and other apps such as Photoshop LightRoom.  I was able to pick this language up in about a week (now I’m not saying I’m an expert at Lua but I would consider myself a decent programmer now).  The syntax is a bit different.  For instance, to declare a local variable you would type “local myVariable” and these are not strong-typed at all.  You can think of this as “public var myVariable” in ActionScript 3.0 terms.  Another difference is there are no “ARRAYS” but rather use use “TABLES” in Lua to achieve storing data.  I have found a “Table_AS3″ package that allows you to store data in “array-like” tables and call methods familiar to the AS3 developer.  There’s a bunch of different libraries/packages you can find in the Corona forums and such and esp in the “Share Your Code” section.  Check it out!

I have been using the Corona Project Manager App to develop in.  You can check it out here: .  So far, it is the best way to develop your project and manage your assets as well.  There is a way to work in TextMate and develop in, then publish to the Corona Simulator as well, but this involves having Terminal open, along with the Simulator, and the TextMate app.  This method reminds me of the old XCODE – where everything was in it’s own separate app.  Corona Project Manager has everything all in one interface.

So far, I have had much success in porting a AS3 Game into the Corona SDK.  This involves programming the entire game from scratch in the Lua language.  I will say that I am quite surprised and pleased how it’s going so far.  I have an intro screen with menu buttons, the main game, and finally the gameover screen.  I am currently exploring how to track the user’s actions as well (web analytics).  Well, until next time.


Flex: Multi-Page Application – Accordion

Programmed an accordion-styled recipe card for one of my favorite dog biscuit recipes “Peanut Butter Doggie Biscuits” (these are awesome treats that I baked for my dog Maya). Includes an awesome photo taken from my iPhone.
[ launch app ]

Flex: Exchanging Data Application

Another simple application I created using the Flex Builder 3. Find shipping options based on the input of “zipcode” and “weight.”
[ launch app ]

Flex: Flickr Application

Created my first project using Flex Builder 3. A simple image search for the Flickr service. After completing this project, I have a basic understanding of the Flex Builder tool – how to get around in the Flex interface, some coding in MXML, and of course some AS 3.0. More projects to be posted in the near future!
[ launch app ]


I have begun the long and tedious journey learning Box2D for AS3.  The documentation is not as good as some classes such as TweenMax.   However, I was able to find a decent blog that contains great examples and even includes some source code.  I had a hard time following the source code because of the small width scrolling textfield.  So I just copied the source code so I could read it easier without side scrolling & with color coding.  I would recommend using NotePad++.

Box2D is rather interesting to work with.  There are many classes to work with and you definitely need to know what is going on with the code.  You need a b2World instance that contains all your Box2D shapes, bodies, etc.  so var myWorld:b2World.  You work with gravity, friction, density, and restitution.  You apply the gravity to your instance of b2World.  Friction, density, and restitution is applied to bodies.  I have experimented with both library items linked to classes and applied the  Box2D code to the library objects.  I have also successfully been able to dynamically create shapes such as boxes and circles.  I see great potential working with it and perhaps combining some Papervision3d to it as well.  The one thing I am struggling with is creating a chain of items.  I have been able to use joints to connect two bodies.  I am looking specifically for a Class in Box2D that allows joining several bodies in a line.  I am thinking the bridge demo has something to do with this.  More researching….

This is a tutorial that goes over mouse dragging & using objects in your Flash library:

A few hours later….

I think I have a rough idea how to get create a chain of shapes.  I will have to tinker with the physics a bit more.  chainjoints