Everybody has to start somewhere and if you had to write code that was perfect none of us would be developing mobile games. Or any other kind of software, for that matter.
Fortunately, the most important thing is to WRITE SOME CODE and worry about making it perfect later. And while I won’t claim the code in this Corona SDK tutorial is perfect, it is a better way to handle displaying multiple objects (of the same type) on the screen at once.
What do I mean? Here’s an example of displaying 4 stars on the screen (not real code, of course):
Create and Display First Star
Create and Display Second Star
Create and Display Third Star
Create and Display Fourth Star
While that may get the job done, it’s a very inefficient way to handle things. And, if you want 10 stars, or 50 stars, your code is going to get very long (and you’ll be bored to death writing it).
This video tutorial will show you a great way to handle this task. And as a bonus, members of GDN will be able to see a follow-up video that takes the tutorial code to the next level. (If you’re not a GDN member, it’s free to join.)
Part 1 of 2
Finally, if you think this Corona SDK tutorial would help others, please Tweet and Like using the buttons below. Thank you!


Very nice tutorial. Thanks.
Really very helpful to beginners like me. I was working on my concept where i had to spawn random boxes with physics…. and so on… and i came across this post and yupeeeee helped me a lot..
Thanks a lot for the small simple Tute.
nice tutorial.thank you so much
got a question to you.i suddenly changed the properties of particular main.lua to be opened with another app(in my case i changed it to corona simulator) and now every time i try to double click main.lua on CPM, it opens the corona simulator. now i’m stuck with it and dont know how to change it back to default way. could you please help me how to do it so everytime i double-click it, it will directly open the editor inside the CPM and make the code editable.thanks
Sounds like Prefs got changed to open the file in an external editor. Open Preferences and under General there’s an option to edit files in CPM or an external editor. Make sure that’s set correctly and try again.
thanks a lot..it works for me now! you rock!
Hi why can’t I view part 2 of this video. It’s telling me to log in and I am but can’t view part 2 ?
I loved out and back in again and still no luck. (I signed up today as well Does that have any thing to do with it ?)
Thanks
Excellent tutorial. Mandatory for all new coders out there, as this saves many lines of code and future maintenance hours, not to mention re-usability.
P.S. The homage to Carl Sagan does not escape me