Ludicrous Software

Mobile and Flash Development

Fixing the Corona Debugger in Snow Leopard

Last week somebody commented on my post about using the Corona debugger that they’re getting an error with one of the daily builds. I tested this out against the latest public build and I experienced the same thing. Here’s what I’m seeing:

dyld: Library not loaded: /usr/lib/libedit.3.dylib
  Referenced from: /Applications/CoronaSDK/debugger
    Reason: image not found
Trace/BPT trap

Build Missile Command With the Corona SDK

Last week I had the pleasure and the honour of being able to deliver both an introduction to Corona presentation and a full-day game development workshop at FITC Screens. The workshop attendees built (most of) a complete cross-platform Missile Command game using the Corona SDK; we ran out of time before we could implement everything you’ll find in the workbook, but we covered all of the basics. I’ve uploaded the materials I used in the workshop to GitHub, so feel free to check it out.

Performance of Local v. Table Functions

Short version: If you’re creating a Lua module with publicly accessible functions, just add the functions as properties of the table you’re returning, rather than as local functions with a table reference. Now for the long(er) version…

Update: added one more example for further context. It’s at the bottom of the post.

Using `do/end` for Disposable Code

This is a quick tip about how to take advantage of scope in Lua to keep memory consumption down. Typically, any application that you write is going to have some initialization code. By this, I mean code that is going to run once and only once. It may set up some initial values, do a bunch of calculations to configure your app for the specific device it’s on, and so on.

Corona Physics: Forced Horizontal/Vertical Bouncing

This recent article on the Ansca web site about solutions to common physics challenges is helpful, but as one commenter notes, the issue of objects “sticking” to walls isn’t easily solved by using the suggestions provided in the article. The commenter notes that the Corona Physics API doesn’t expose the collision properties required to properly handle these sticky (ha ha) situations. So here’s how you can hack around the problem when your walls are completely horizontal or vertical (situations where the collision is with non-horizontal/vertical objects are somewhat more complicated, and I’ll deal with those in a subsequent blog post).

Fastest Way to Remove All Event Listeners

Removing the event listeners that you’ve created is key to avoiding memory leaks in your Corona applications. Here’s a simple little function that will remove all of the event listeners attached to a particular object.

Using the Corona Debugger

I have to confess: I do not write bug-free Lua code (I know, shocking). Much of the time, judicious use of print() statements will be enough to help me figure out just where things have gone off the rails. But every so often, that’s not enough, and so I turn to the debugger that ships with the Corona SDK - that’s right, there’s a debugger hidden away in the SDK (actually a version of RemDebug). While it doesn’t have a nice GUI to make working with it a little easier - you’ll spend quite a bit of time on the command line - it has a lot of functionality. This post will show you how to start and use the debugger.

Corona Ads API Tutorial

With the recent release of the latest version of the Corona SDK, Ansca has gone and made my AdMob hack obsolete - not that I’m complaining: it’s nice to see native ad support in Corona. I thought I’d kick the tires on it and put together a quick tutorial on how to set up ads in your app. There are a couple of gotchas that I encountered, so hopefully this will save you some hassle as you incorporate ads into your own app.