Automatic LUA Compiler - Work In Progress

Hey Forum! 

I’m relatively new to Corona. I joined a while ago but the LUA code scared me off, and so naturally I decided to go with Gamesalad. However the apps I am creating now require a high performance engine, and other features, which Gamesalad currently lacks, which is why for the last few weeks I have been learning LUA, and I can honestly say it is going very well! However I am still hooked on the simplicity of Gamesalad, so I decided to work on a LUA Compiler, that takes user inputs and converts them directly into LUA Code!!!

The project is currently in its primary phase, I can add global and local variables, add images and image data, if statements, change variables, move an object. I am currently looking for an experienced developer to move forward with more complex tasks, however have started working towards adding physics. The aim is to work out a generalised method of writing in LUA, which takes best practices into consideration. In the end, even if the spreadsheet is not capable of providing everything Corona has to offer, it will speed up a lot of processes, and you will be able to simply add the additional ones in later directly :smiley:

Let me know what you think! I am making this with the community in mind since I wish this tool to be accessible by all. If done right, it will open up Corona to a wider audience and make a simple code even simpler without the need for it!!!

To add to the list of things the following things can now be accomplished by the spreadsheet, 

Add Rectangle and define size, position and fill colour

Add Circle and define size position and fill colour

Add Text and define Position and Size

Add Reference Points to Images

Change Alpha of Image

Rotate Images

Its coming along very well, looking forward to getting stuck into including the physics engine!!!

Hey guys, 

I can now define physics bodies!!! All elements on a single sheet of the spreadsheet will refer to a single LUA file, therefore a scene. If none of the elements contain physics in the scene, it will not be added into the lua file. Activating a single physics body with automatically require the physics engine and start it. 

Next I’ll be trying to break down the various actions required in game development, and work towards a generalised system for compiling the code. 

I have looked into Userforms, and thinking to add a userform for those who wish to enter data from drop down lists etc, and those hardcore coders amongst you who will be able to pick up the logic behind the spreadsheet quick can directly enter logical expressions that comply with the syntax that I am going by. 

the video below show you how the spreadsheet functions, have a look and leave your thoughts… 

https://www.youtube.com/watch?v=x_BtAiFewLY

So is the ultimate goal to produce a Windows & OSX editor like gamesalad that automatically compiles into a working corona program?

@nick_sherman That is what I hope to achieve, yes. I was in a position where I wanted to brush up my excel skills and also learn Corona at the same time, lol, so I figured I’ll apply them together and see what come out at the other end. So far its functioning fine, however I’m only just defining things, which shouldn’t have posed any problems anyway. The real fun comes when I begin the more logic intensive stuff, but I’ll be adding to it slowly as I learn more about the code. 

If you or any one else have any tips on best practices leave a reply, I’m only days into learning the code but I’ve picked up a bit! 

Consider using tables to store your variables and objects, rather than setting up a local variable each time. Also use tables to store common objects. This way you don’t run into any problems with the limit on local variables.

i.e.

[lua]

local monster1

local monster2

local monster3

local player

local ball

[/lua]

could be replaced by:

[lua]

local v = {}

v.monster = {}

v.player

v.ball

[/lua]

You’ll might also want to split objects into different display groups - i.e one group for your hud, one for background images, one for characters.

Thats a nice feature, I’ll try and incorporate that, at the moment I’ve set a condition that automatically names shapes for the user, however it depends on the element number. for example if the user makes the first element a rectangle it will be auto named rectangle1, then decided to add an image into element 2 followed by a rectangle in element 3, which would be auto named rectangle3, so there is no data in rectangle2… I think this might pose an issue, since rectangle2 would be “nil” however the ability to include elements in tables is far more powerful than auto naming, I’ll work on this! 

I’ve just started looking into grouping, I’ll hopefully have this implemented soon!

Cheers!

To add to the list of things the following things can now be accomplished by the spreadsheet, 

Add Rectangle and define size, position and fill colour

Add Circle and define size position and fill colour

Add Text and define Position and Size

Add Reference Points to Images

Change Alpha of Image

Rotate Images

Its coming along very well, looking forward to getting stuck into including the physics engine!!!

Hey guys, 

I can now define physics bodies!!! All elements on a single sheet of the spreadsheet will refer to a single LUA file, therefore a scene. If none of the elements contain physics in the scene, it will not be added into the lua file. Activating a single physics body with automatically require the physics engine and start it. 

Next I’ll be trying to break down the various actions required in game development, and work towards a generalised system for compiling the code. 

I have looked into Userforms, and thinking to add a userform for those who wish to enter data from drop down lists etc, and those hardcore coders amongst you who will be able to pick up the logic behind the spreadsheet quick can directly enter logical expressions that comply with the syntax that I am going by. 

the video below show you how the spreadsheet functions, have a look and leave your thoughts… 

https://www.youtube.com/watch?v=x_BtAiFewLY

So is the ultimate goal to produce a Windows & OSX editor like gamesalad that automatically compiles into a working corona program?

@nick_sherman That is what I hope to achieve, yes. I was in a position where I wanted to brush up my excel skills and also learn Corona at the same time, lol, so I figured I’ll apply them together and see what come out at the other end. So far its functioning fine, however I’m only just defining things, which shouldn’t have posed any problems anyway. The real fun comes when I begin the more logic intensive stuff, but I’ll be adding to it slowly as I learn more about the code. 

If you or any one else have any tips on best practices leave a reply, I’m only days into learning the code but I’ve picked up a bit! 

Consider using tables to store your variables and objects, rather than setting up a local variable each time. Also use tables to store common objects. This way you don’t run into any problems with the limit on local variables.

i.e.

[lua]

local monster1

local monster2

local monster3

local player

local ball

[/lua]

could be replaced by:

[lua]

local v = {}

v.monster = {}

v.player

v.ball

[/lua]

You’ll might also want to split objects into different display groups - i.e one group for your hud, one for background images, one for characters.

Thats a nice feature, I’ll try and incorporate that, at the moment I’ve set a condition that automatically names shapes for the user, however it depends on the element number. for example if the user makes the first element a rectangle it will be auto named rectangle1, then decided to add an image into element 2 followed by a rectangle in element 3, which would be auto named rectangle3, so there is no data in rectangle2… I think this might pose an issue, since rectangle2 would be “nil” however the ability to include elements in tables is far more powerful than auto naming, I’ll work on this! 

I’ve just started looking into grouping, I’ll hopefully have this implemented soon!

Cheers!