Yes, you need to learn Lua, but more importantly you need to learn programming in general.
Corona SDK isn’t a language, its a combination of API (Application Programming Interface) and Tools that let you use the Lua language to do things with the API and in the end produce an application.
For instance, Lua doesn’t know how to load an image on the screen and move it (well you probably could with a lot of code), but the Corona SDK API lets you do it a few lines of Lua code.
As for how to make a complete game, there will be quite a few game developer books out there. None will be with Lua or Corona SDK, but you can learn what all goes into a game. With Borders going out of business, now would be a good time to stock up!
Now to get you started, most all games will have multiple screens like a menu screen, help, credits, high scores, etc. Get the “Director Class” from this site and use it to manage all of those screens. Basically you create a Lua file for each screen, link to them from the menu.lua file and volia, the PITA (Pain in the Ass) parts will be decently maintained.
Then you can focus on your game.lua (unless you’re doing different levels, in which case you will have multiple level1.lua level2.lua etc. files).
Once you are in your game code, you most likely will need something called a “Game Loop”. This is a loop that runs and does things like move your objects around, detect when things hit each other, and so on.
Corona SDK and Lua uses things called “events” to do this work for you and it has its own game loop that does a lot of this processing in the background. Lets say your building a game that uses physics. In code you don’t touch, they take care of moving your objects based on the physics affecting it. When things happen like when things bump into you, Corona will generate an event. You need to write code to do something when that event happens and register that code with the program. This is called adding an event listener.
Lets say your building the Tron motorcycle game where the bikes leave a wall of color behind them and the object is to trap the other bike. So when the Blue bike hits a color wall, an event is triggered. You write the code that says what happens when a bike hits a wall like maybe calling your game over code. You handle the event, tell the system you are done and life goes on.
Sometimes you need to have your own game loop and that’s done with a special event listener called “enterFrame” which fires every 1/30h of a second (or 1/60th depending on your set frame rate).
In my game OmniBlaster (http://bit.ly/omniblaster) I did not use physics, so I had to do my own detection to see when things hit each other. So I created a Lua function named “gameLoop” (very creative I know) and added it as my event listener for the “enterFrame” event, so 30 times a second that function gets called. In that function, I detect if any of my on screen objects are touching (Collision detection) and if they are, I do something about it (blow something up, give points or take away shields/lives depending on what hit what)
Maybe that will give you something to start on. [import]uid: 19626 topic_id: 12851 reply_id: 47148[/import]