Hi,
I have a problem and I don’t know if it’s related with Corona SDK or Lua itself so I’m asking here.
My problem is that when I try to read a Lua table from a file, I noticed that it is being read out of order like reading first of 5 entries and then reading the last one etc. goes on like this.
Is there a way to overcome this issue or do I need to figure out a workaround to the problem?
[lua]
function getData()
local levelData = {}
levelData.background = “images/levels/level1/background.jpg”
levelData.objects =
{
heartNecklace =
{
src = “images/levels/level1/necklace.png”,
x = 170,
y = 83,
},
playingCardBox =
{
src = “images/levels/level1/cardbox.png”,
x = 311,
y = 55,
},
tableTennisRacket =
{
src = “images/levels/level1/racket.png”,
x = 430,
y = 66,
},
statueOfLiberty =
{
src = “images/levels/level1/statue.png”,
x = 350,
y = 66,
},
}
return levelData
end
[/lua]
The read order is like this:
[lua]
heartNecklace
statueOfLiberty
tableTennisRacket
playingCardBox
[/lua] [import]uid: 154911 topic_id: 36282 reply_id: 336282[/import]