Game Dev Nation
  • Twitter
  • RSS
Game Dev Tools, Tips, and Tutorials
  • Home
    • Indie Game Dev and Scrum
    • Robotronish – A Mobile Game Inspired by Robotron 2084
    • About
    • Blog
    • Contact
  • Featured
  • Solar2D Tutorials
  • GDN Membership
    • Members
      • Audio Editing Secrets
      • Programming Profits
  • Unity 2D Game Dev
    • Pixelnest Tutorial
Search the site...

Billions of Stars

March 22, 2012 / Jay / Featured, Game Development, Solar2D, Solar2D Tutorials, Video Tutorials
9
Corona SDK Tutorial for Displaying Multiple Objects

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):

Lua
1
2
3
4
5
6
7
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

Click here to join GDN (free!) to see the second video (Part 2 of 2) and download the project files (or log in at the left if you’re already a member).

Finally, if you think this Corona SDK tutorial would help others, please Tweet and Like using the buttons below. Thank you!

Please share:

  • Share
  • Tweet
  • Email

Like this:

Like Loading...
graphics, tutorial

9 comments on “Billions of Stars”

  1. Russ Taber says:
    March 23, 2012 at 1:17 pm

    Very nice tutorial. Thanks.

    Reply
  2. Siddhesh Meher says:
    March 28, 2012 at 12:18 am

    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.

    Reply
  3. jim irawan says:
    April 4, 2012 at 2:44 am

    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

    Reply
    • Jay says:
      April 4, 2012 at 3:00 am

      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.

      Reply
      • jim irawan says:
        April 4, 2012 at 8:37 am

        thanks a lot..it works for me now! you rock!

        Reply
  4. malik theresine says:
    July 10, 2012 at 7:01 pm

    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

    Reply
  5. @CoronaJunkie says:
    November 10, 2012 at 6:36 am

    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 😉

    Reply
  6. Christian Strang says:
    May 23, 2013 at 4:01 am

    I also have the same problem as malik, wtf GDN?

    Reply
    • Jay says:
      May 23, 2013 at 4:11 am

      In every case I can remember the problem is a matter of not clicking the link in the verification email that was sent out. You sign up, but then an email is sent to you and you have to click the link in that email. It’s possible the verification email was accidentally routed to your junk/spam folder.

      Check that and if it’s not there (not sure why it sometimes gets misrouted) I can manually verify you. Let me know.

      Jay

      Reply

Leave a Reply Cancel reply

Solar2D Game Course Bundle

Unity FPS Creator Bundle Asset

Get More Game Dev Info!

Recent Features

  • Murder and Mayhem with Solar2D

    August 4, 2020
  • Solar2D Composer Book Online

    July 29, 2020
  • How to Become a Part-Time Indie Game Developer

    September 7, 2016
  • Firing Up A “Tired” Game Type

    August 5, 2016
  • Birth of a New Game Dev Video Course

    July 31, 2016
  • My Favorite Sites for 2D Art

    November 6, 2015

Site Sponsors

WordPress Arcade Plugin Ad Square

Lo Shu

Ad Square

Categories

  • Adventure Game Machine
  • Articles
  • Blog
  • Featured
  • Game Design
  • Game Dev Online
  • Game Development
  • Game Tools
  • General
  • Horse Crazy
  • HTML5
  • Indie Game Dev and Scrum
  • Latest News (Members)
  • Lua
  • Members Only
  • Moai
  • Robotronish
  • Solar2D
  • Solar2D Tutorials
  • Stencyl
  • Unity
  • Unity 2D
  • Video Tutorials
  • Zombies Ate My Poodle

Recommended

Game Development Stuff

While GDN started as a tutorial site for Corona SDK (now called Solar2D), it kind of morphed into a general game dev site. It’s focused mainly on news of interest to game developers. New tools, tutorials, industry shifts, etc. But the site also contains tutorials for Solar2D and Unity 2D game developers.

Recent Posts

  • #Devtober 2020 – Day 11
  • #Devtober 2020 – Day 1
  • Head to the Playground
  • Release Solar2D 2020.3611
  • Why Solar2D for Game Dev?
  • Murder and Mayhem with Solar2D
  • Solar2D Composer Book Online

Recommended Sites

  • Solar2D Game Dev Framework
  • Solar2D Video Tutorial Courses
Copyright 2014-2020 Three Ring Ranch

Disclosure

This site contains affiliate links, which means we may receive a commission if you click a link and purchase something that we have recommended. While clicking these links won’t cost you any money, they will help me fund my development projects while recommending great game dev assets!

Jetpack has locked your site's login page.

Jetpack has locked your site's login page.

Your IP address 185.129.62.62 has been flagged for potential security violations. You can unlock your login by sending yourself a special link via email. Learn More

Get help unlocking your site