Category: Tutorials, Tips and Demos

Tutorial: Using System Events to Save App State

Something that’s becoming increasingly popular is the ability to “pick up where you left off” or stop and resume with hardly any friction. More and more, apps are starting off exactly how you left them—and that doesn’t exclude mobile apps (in fact, mobile is arguably what inspired this behavior).

Having your apps start off where your user left them is also known as “state saving”, and that’s exactly what I’m going to cover in this tutorial. As with any tutorial that’s posted here, I encourage you to take what you learn and build upon or modify the code to suit the specific needs of your app.

READ MORE

Best Practices for Organizing Projects

Something that isn’t clear by studying Corona’s included SampleCode or any of the other examples and tutorials on this website is the concept of organizing projects. We’ve sort of just let you know that everything goes into your project folder and sent you off on your way—and oh, sub-folders are supported. That’s about all we’ve said on the subject up until now.

However, as your projects get bigger, that may not be quite enough. With more and more resources are being added to your project, such as audio files, images, videos, Lua modules, etc. it can add a whole new layer of complexity to the development process—complexity that isn’t at all necessary.

This tutorial is by no means the end-all to Corona SDK project organization techniques, but it will introduce you to an effective one that you can tweak at your heart’s content to suit your needs perfectly.

READ MORE

Properly Removing Objects and Variables

Removing objects and getting rid of unneeded variables may seem trivial, but it’s actually common question among Corona newcomers and veterans alike.

The potential consequences of doing this simple-but-important task incorrectly can lead to memory leaks, app slowdowns, and even crashes (which you don’t want, obviously).

READ MORE

How to Use Custom Events in Corona

A little over a year ago (in June of 2011), I went over the Corona Event Model, and explained exactly what events are in Corona, when they occur, and how you can “hook” into them to take advantage of some of Corona’s best features.

However, in the previous article, I kept the subject-matter focused on the built-in events associated with specific API’s that are provided out-of-the-box in Corona. What I didn’t mention is that you can define your own custom events, and have objects listen for when those events are dispatched (which you have complete control over as well).

This tutorial will walk you through defining and dispatching custom events, so you can begin applying the knowledge to your own games and apps.

READ MORE

Guided Tour of Corona’s API Reference

This week’s tutorial is going to be a little different. Rather than go over yet another awesome Corona feature, I’ll instead be walking you through another aspect of Corona development that’s arguably just as important (if not more important) than any one specific feature of the SDK. What you’ll be learning about today is something you’ll undoubtedly use in every single Corona project you work on, and that is of course is the Corona SDK API Reference.

READ MORE

Tutorial: Property Callbacks

If you know what events are Corona (if you don’t, you should start here), then you know that they allow you to “do something” whenever a specific action that corresponds to an event occurs. You can even define your own …

READ MORE