Corona Game Template in Lua

This is a template I threw together for the Corona SDK from Ansca Mobile. Since Lua is not a language most people are familiar with, I figured I’d throw together some sample code for Corona and share what I learned so far with the rest of the Corona SDK community by including the template here.

The template includes example code for:

  • Display groups
  • Orientation and accelerometer
  • Touch with buttons
  • File reading
  • Example level file for scripting game play

The template separates functionality into modules for an object oriented approach. I’m still learning the techniques for Lua, so if you notice a better way to do it, please don’t hesitate to let me know in the comments below. Some things in the template are not the best way to accomplish some things, but should give people a good idea on best practices of software design. This will also with work Corona’s Game Edition.

If you find the template useful, please consider buying a copy of our current application to support us. It’d mean a lot. Also, check out our company website if you’re an iPhone programmer as we’re looking to bring on some independent programmers.

Download the Template Code

Again, if this helps you out and you want to support us, check out the links on the side. Thanks!

Related posts:

  1. Building a Game
  2. Why Your Code Sucks – Naming Conventions
  3. A Very European Christmas
  4. Dynamic Textfields in Flash AS3 and Their Bugs
  5. iPhone Pricing
  6. Handling Your Initial View Controllers for iPhone
  7. Some of My Old Music – Part 3 of 4
  8. Open Season on Work Related Matters

4 Responses to “Corona Game Template in Lua”

  • Dan Says:

    Thanks for the Corona Game Template Code. But how does one use it? I downloaded “CoronaGameTemplate.zip”. I unzip that and get “CoronaGameTemplate.zip.cpgz”. I double click that and get “CoronaGameTemplate.zip”. I unzip that and get “CoronaGameTemplate.zip.cpgz”. Is this some kind of joke?

  • Dan Says:

    Oh by the way. I could download the template and to be sure… it’s not a joke! It’s very helpful. Thank you for your time and effort.

  • Gilbert Says:

    Great template! Looks like you put a lot of work into this. Thanks for sharing!

    • Mike Says:

      Thanks. Glad you like it. Just figured since I banged my head enough trying to make Lua more like OOP that others were doing the same. I’ll be updating this soon to put in some more things that I’ve learned as we wrap up our game. Thanks again!

Leave a Reply