How to Build an App with Corona SDK
Today at GadgetCore, we’re doing something we don’t usually do – a tutorial! (Gasp). All the current hype these days seems to be centred around rich developers and their iPhone/Android apps that have made them millions! Well, today we’re going to create a really quick app that teaches you how to get started at making your own apps/games using the awesome physics based Corona Source Development Kit.
This tutorial is for:
- Beginners and…
- …Absolutely anybody
Today we will be learning how to:
- Create a project for Corona SDK
- Generate the necessary files for a basic app
- And create the classic: “Hello World!” scenario in Lua code
Let’s jump right in.
1) First you’re going to have to download the Corona SDK. Although to publish your games you’ll need a license, it’s totally free to download and create games with! So, grab a copy from here and once that’s installed you should see several new icons – the Corona Simulator and Corona Debugger. We’ll come to these soon.
2) Next you’re going to create a new folder for your projects anywhere. It doesn’t matter what you call it, and it doesn’t matter where you put it. Just remember where it’s created!
3) Next, we need to create a new .lua file called “main”. Now this can be done in many different ways. Firstly, Notepad or some other program can do the job – but I recommend Notepad ++ for Syntax highlighting. Open up your word processor (not MS Word, that won’t work) and don’t type anything.
4) Save the file as main, BUT not as a .txt file. To change to a .lua file, click the drop down menu that says text file, and click “all files” and call the file main.lua
5) Next, we’ll enter some code:
helloText = display.newText( "Hello World!", 20, 40, "Verdana", 32 )
helloText:setTextColor( 0, 0, 255 )
What this code does it create a new set text, “helloText”, with the string “Hello World!”, the coordinate (20,40) and font style Verdana and font size 32.
The next line simply change the colour of said text to blue, as the number are (R, G, B)
6) This file should then be saved in a new folder in the original project folder, so it should appear like this: Corona Projects –> Hello World –> main.lua
7) Finally, load up the Corona Simulator, select “Continue Trial”, then “Open a Project in Corona Simulator”. Navigate to your project folder, and open the main.lua file. Et voila! Hopefully, if all went well, you should see something like this:
Congratulations, you’ve built a fully working iPhone/Android app!
The great thing about Corona SDK is that it gives you the ability to publish to both platforms, and it has a great built in physics engine.
More tutorials and reviews coming soon, so stay tuned…